]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR debug/51032 - ICE in dbxout_type, at dbxout.c:2372
authorDodji Seketeli <dodji@redhat.com>
Wed, 9 Nov 2011 07:51:12 +0000 (07:51 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Wed, 9 Nov 2011 07:51:12 +0000 (08:51 +0100)
gcc/cp/

* decl2.c (check_member_template): Accept alias templates and ...
* parser.c (cp_parser_alias_declaration): ... use it here.

gcc/testsuite/

* g++.dg/cpp0x/alias-decl-debug-0.C: New test.

From-SVN: r181193

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/alias-decl-debug-0.C [new file with mode: 0644]

index 58241a8088fcfed86d738b7313987424c1fb1fb6..6445befedd33d0a2c1f8393052f135ea918f7537 100644 (file)
@@ -1,3 +1,9 @@
+2011-11-09  Dodji Seketeli  <dodji@redhat.com>
+
+       PR debug/51032
+       * decl2.c (check_member_template): Accept alias templates and ...
+       * parser.c (cp_parser_alias_declaration): ... use it here.
+
 2011-11-08  Jason Merrill  <jason@redhat.com>
 
        PR c++/50835
index 3dc5a69df5445ba62d6f81666f09af62e2ef95c3..4e24755e2a5e2a7b78b8f66db2a4a4b64886dc07 100644 (file)
@@ -495,6 +495,7 @@ check_member_template (tree tmpl)
   decl = DECL_TEMPLATE_RESULT (tmpl);
 
   if (TREE_CODE (decl) == FUNCTION_DECL
+      || DECL_ALIAS_TEMPLATE_P (tmpl)
       || (TREE_CODE (decl) == TYPE_DECL
          && MAYBE_CLASS_TYPE_P (TREE_TYPE (decl))))
     {
index 12f3c4011facacb698002b3beb072076ebbcf54b..fde4c6d838f8daad62eb963a74a716deaa2f1e68 100644 (file)
@@ -14932,6 +14932,7 @@ cp_parser_alias_declaration (cp_parser* parser)
   location_t id_location;
   cp_declarator *declarator;
   cp_decl_specifier_seq decl_specs;
+  bool member_p;
 
   /* Look for the `using' keyword.  */
   cp_parser_require_keyword (parser, RID_USING, RT_USING);
@@ -14957,7 +14958,8 @@ cp_parser_alias_declaration (cp_parser* parser)
   declarator = make_id_declarator (NULL_TREE, id, sfk_none);
   declarator->id_loc = id_location;
 
-  if (at_class_scope_p ())
+  member_p = at_class_scope_p ();
+  if (member_p)
     decl = grokfield (declarator, &decl_specs, NULL_TREE, false,
                      NULL_TREE, attributes);
   else
@@ -14976,7 +14978,12 @@ cp_parser_alias_declaration (cp_parser* parser)
   if (DECL_LANG_SPECIFIC (decl)
       && DECL_TEMPLATE_INFO (decl)
       && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl)))
-    decl = DECL_TI_TEMPLATE (decl);
+    {
+      decl = DECL_TI_TEMPLATE (decl);
+      if (member_p)
+       check_member_template (decl);
+    }
+
   return decl;
 }
 
index 80a36622b8cef15b95d08075ae4b68978dc12304..4abcf0784a4feff4b710e3dd4e9f7b9c87a2e90c 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-09  Dodji Seketeli  <dodji@redhat.com>
+
+       PR debug/51032
+       * g++.dg/cpp0x/alias-decl-debug-0.C: New test.
+
 2011-11-09  Ira Rosen  <ira.rosen@linaro.org>
 
        PR tree-optimization/51015
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-debug-0.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-debug-0.C
new file mode 100644 (file)
index 0000000..4c00bdd
--- /dev/null
@@ -0,0 +1,11 @@
+// Origin: PR c++/51032
+// { dg-options "-std=c++0x -gstabs+" }
+
+template <class C>
+struct A {
+    template<class U> using B = U*;
+    int a;
+};
+
+A<int> a;
+