decl2.c (grokfield): Don't mangle the name of a TYPE_DECL is it uses template parameters.
authorMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 3 Aug 1998 09:58:34 +0000 (09:58 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 3 Aug 1998 09:58:34 +0000 (09:58 +0000)
* decl2.c (grokfield): Don't mangle the name of a TYPE_DECL is it
uses template parameters.

From-SVN: r21548

gcc/cp/decl2.c
gcc/testsuite/g++.old-deja/g++.pt/crash17.C [new file with mode: 0644]

index 3aa5d73..998b346 100644 (file)
@@ -1642,8 +1642,9 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
       /* Now that we've updated the context, we need to remangle the
         name for this TYPE_DECL.  */
       DECL_ASSEMBLER_NAME (value) = DECL_NAME (value);
-      DECL_ASSEMBLER_NAME (value) =
-       get_identifier (build_overload_name (TREE_TYPE (value), 1, 1));
+      if (!uses_template_parms (value))
+       DECL_ASSEMBLER_NAME (value) =
+         get_identifier (build_overload_name (TREE_TYPE (value), 1, 1));
 
       pushdecl_class_level (value);
       return value;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash17.C b/gcc/testsuite/g++.old-deja/g++.pt/crash17.C
new file mode 100644 (file)
index 0000000..c4dd969
--- /dev/null
@@ -0,0 +1,10 @@
+// Build don't link:
+
+template <int B>
+class foo;
+
+template <class U>
+class bar
+{
+  typedef foo<(U::id > 0)> foobar;
+};