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 9c09c134c47fb5c68161e6cc3bc331e4021174a0..1dae892c8b2ecab5939bdc7e8a19a3f63188eb34 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 8f88b10fef3c25531912035169c783ad3761ed5b..04dc4fcf1a959eff2d60032295141bce1b7135cb 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 30882a6fe8d192203c6a4e0ac7fdea648cae17fc..ccdafa50d4c3159b8733fa2434189966a5b96456 100644 (file)
@@ -1,6 +1,5 @@
 // PR c++/57041
 // { dg-options "-std=gnu++11" }
-// { dg-prune-output "error:" }
 
 template<typename T>
 union u {