commit 6a9489bb28a4caf64e1b27ce35522990590a74a4
Author: Jason Merrill <jason@redhat.com>
Date: Tue May 14 09:08:15 2013 -0400
PR c++/57041
* pt.c (tsubst_copy_and_build): Don't recur into a designator.
@@ -14359,7 +14359,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))
@@ -1,6 +1,5 @@
// PR c++/57041
// { dg-options "-std=gnu++11" }
-// { dg-prune-output "error:" }
template<typename T>
union u {
On 05/13/2013 03:20 PM, Jason Merrill wrote: > If we don't like the designator, we should fail pleasantly. And we ought to accept this case, anyway.