From 35fce3ceb224573662197f067f5e6e13d3a43f5d Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 3 Aug 1998 09:58:34 +0000 Subject: decl2.c (grokfield): Don't mangle the name of a TYPE_DECL is it uses template parameters. * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL is it uses template parameters. From-SVN: r21548 --- gcc/cp/decl2.c | 5 +++-- gcc/testsuite/g++.old-deja/g++.pt/crash17.C | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/crash17.C (limited to 'gcc') diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 3aa5d73..998b346 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -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 index 0000000..c4dd969 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash17.C @@ -0,0 +1,10 @@ +// Build don't link: + +template +class foo; + +template +class bar +{ + typedef foo<(U::id > 0)> foobar; +}; -- cgit v1.1