aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-05-14 10:19:15 -0400
committerJason Merrill <jason@gcc.gnu.org>2013-05-14 10:19:15 -0400
commitadce5cdf6f3f32dca2004892b369157284e9c0d5 (patch)
treec207ff0e3bb1df6cbf58baafa8066b1bb865682e /gcc
parentfc7721ee68a02651b6d8d4b2958fe02c7b02342a (diff)
downloadgcc-adce5cdf6f3f32dca2004892b369157284e9c0d5.zip
gcc-adce5cdf6f3f32dca2004892b369157284e9c0d5.tar.gz
gcc-adce5cdf6f3f32dca2004892b369157284e9c0d5.tar.bz2
re PR c++/57041 (ICE in lookup_field_1, at cp/search.c:376 (with dot-prefixed structure initialisation))
PR c++/57041 * pt.c (tsubst_copy_and_build): Don't recur into a designator. From-SVN: r198887
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c5
-rw-r--r--gcc/testsuite/g++.dg/ext/desig6.C1
3 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9c09c13..1dae892c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 8f88b10..04dc4fc 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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))
diff --git a/gcc/testsuite/g++.dg/ext/desig6.C b/gcc/testsuite/g++.dg/ext/desig6.C
index 30882a6..ccdafa5 100644
--- a/gcc/testsuite/g++.dg/ext/desig6.C
+++ b/gcc/testsuite/g++.dg/ext/desig6.C
@@ -1,6 +1,5 @@
// PR c++/57041
// { dg-options "-std=gnu++11" }
-// { dg-prune-output "error:" }
template<typename T>
union u {