Commit a7cd72be by Jason Merrill Committed by Jason Merrill

re PR c++/51827 (Error: 'FOO' conflicts with a previous declaration, with PCH/LTO/C++11)

	PR c++/51827
	* mangle.c (mangle_decl): Don't mangle uninstantiated templates.

From-SVN: r183221
parent d836651c
2012-01-16 Jason Merrill <jason@redhat.com>
PR c++/51827
* mangle.c (mangle_decl): Don't mangle uninstantiated templates.
PR c++/51868
* typeck.c (build_static_cast_1): Handle bit-fields properly.
......
......@@ -3330,7 +3330,21 @@ get_mangled_id (tree decl)
void
mangle_decl (const tree decl)
{
tree id = get_mangled_id (decl);
tree id;
bool dep;
/* Don't bother mangling uninstantiated templates. */
++processing_template_decl;
if (TREE_CODE (decl) == TYPE_DECL)
dep = dependent_type_p (TREE_TYPE (decl));
else
dep = (DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)
&& any_dependent_template_arguments_p (DECL_TI_ARGS (decl)));
--processing_template_decl;
if (dep)
return;
id = get_mangled_id (decl);
SET_DECL_ASSEMBLER_NAME (decl, id);
if (G.need_abi_warning
......
2012-01-16 Jason Merrill <jason@redhat.com>
PR c++/51827
* g++.dg/pch/mangle1.{C,Hs}: New.
2012-01-16 Mikael Morin <mikael@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
......
// { dg-options -std=c++11 }
#include "mangle1.Hs"
// PR c++/51827
// { dg-options "-flto -std=c++0x" }
template<typename X> struct S { };
template<typename Y> struct T {
template <typename ... A> T(S <A ...>);
};
inline void f(T<int>) { }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment