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.
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>
--- /dev/null
+// 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>) { }