On Mon, Jan 16, 2012 at 10:29 PM, Jason Merrill <ja...@redhat.com> wrote: > When outputting PCH/LTO, the compiler tries to generate mangled names for > all decls before discarding language-specific data. But that doesn't make > sense for templates, and leads to conflicts in this case. Fixed by refusing > to mangle templates. > > Tested x86_64-pc-linux-gnu, applying to trunk.
Hmm. Using -flto when generating a precompiled header doesn't make sense. We probably should drop -flto silently or complain here. Thus, Index: c-family/c-opts.c =================================================================== --- c-family/c-opts.c (revision 183205) +++ c-family/c-opts.c (working copy) @@ -1058,6 +1058,13 @@ c_common_post_options (const char **pfil && flag_preprocess_only && !flag_no_line_commands) pp_dir_change (parse_in, get_src_pwd ()); + /* Disable LTO output when outputting a precompiled header. */ + if (pch_file && flag_lto) + { + flag_lto = 0; + flag_generate_lto = 0; + } + return flag_preprocess_only; } any objection to that? Thanks, Richard.