re PR c++/57041 (ICE in lookup_field_1, at cp/search.c:376 (with dot-prefixed structu...
authorJason Merrill <jason@redhat.com>
Tue, 14 May 2013 14:19:15 +0000 (10:19 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 14 May 2013 14:19:15 +0000 (10:19 -0400)
PR c++/57041
* pt.c (tsubst_copy_and_build): Don't recur into a designator.

From-SVN: r198887

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/ext/desig6.C

index 9c09c13..1dae892 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-14  Jason Merrill  <jason@redhat.com>
+
+       PR c++/57041
+       * pt.c (tsubst_copy_and_build): Don't recur into a designator.
+
 2013-05-14  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/53903
index 8f88b10..04dc4fc 100644 (file)
@@ -14401,7 +14401,10 @@ tsubst_copy_and_build (tree t,
         newlen = vec_safe_length (n);
        FOR_EACH_VEC_SAFE_ELT (n, idx, ce)
          {
-           if (ce->index && process_index_p)
+           if (ce->index && process_index_p
+               /* An identifier index is looked up in the type
+                  being initialized, not the current scope.  */
+               && TREE_CODE (ce->index) != IDENTIFIER_NODE)
              ce->index = RECUR (ce->index);
 
             if (PACK_EXPANSION_P (ce->value))
index 30882a6..ccdafa5 100644 (file)
@@ -1,6 +1,5 @@
 // PR c++/57041
 // { dg-options "-std=gnu++11" }
-// { dg-prune-output "error:" }
 
 template<typename T>
 union u {