re PR c++/55262 ([C++0x] g++.dg/cpp0x/inh-ctor10.C ICEs with -g)
authorJason Merrill <jason@redhat.com>
Mon, 19 Nov 2012 14:05:48 +0000 (09:05 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 19 Nov 2012 14:05:48 +0000 (09:05 -0500)
PR c++/55262
* method.c (implicitly_declare_fn): Set DECL_PARM_INDEX on
the parms of an inheriting ctor.

From-SVN: r193622

gcc/cp/ChangeLog
gcc/cp/method.c
gcc/testsuite/g++.dg/cpp0x/inh-ctor10.C

index 6d4ab8b..088959f 100644 (file)
@@ -1,5 +1,9 @@
 2012-11-19  Jason Merrill  <jason@redhat.com>
 
+       PR c++/55262
+       * method.c (implicitly_declare_fn): Set DECL_PARM_INDEX on
+       the parms of an inheriting ctor.
+
        PR c++/55261
        * class.c (add_implicitly_declared_members): Use
        lookup_fnfields_slot to get the base constructors.
index 6458032..6dcb63a 100644 (file)
@@ -1663,10 +1663,14 @@ implicitly_declare_fn (special_function_kind kind, tree type,
   else if (kind == sfk_inheriting_constructor)
     {
       tree *p = &DECL_ARGUMENTS (fn);
+      int index = 1;
       for (tree parm = inherited_parms; parm != void_list_node;
           parm = TREE_CHAIN (parm))
        {
          *p = cp_build_parm_decl (NULL_TREE, TREE_VALUE (parm));
+         retrofit_lang_decl (*p);
+         DECL_PARM_LEVEL (*p) = 1;
+         DECL_PARM_INDEX (*p) = index++;
          DECL_CONTEXT (*p) = fn;
          p = &DECL_CHAIN (*p);
        }
index de57453..56c5bd6 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-options "-std=c++11" }
+// { dg-options "-std=c++11 -g" }
 
 struct A
 {