diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d3709fa38ad..fc10e956078 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2013-08-09 Paolo Carlini + + Revert: + 2013-08-07 Paolo Carlini + + PR c++/46206 + * name-lookup.c (lookup_name_real_1): Handle iter->type before + iter->value. + 2013-08-07 Paolo Carlini PR c++/46206 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 05f048068b3..0fe02469138 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4740,11 +4740,11 @@ lookup_name_real_1 (tree name, int prefer_type, int nonclass, bool block_p, continue; /* If this is the kind of thing we're looking for, we're done. */ - if ((flags & LOOKUP_PREFER_TYPES) - && qualify_lookup (iter->type, flags)) - binding = iter->type; - else if (qualify_lookup (iter->value, flags)) + if (qualify_lookup (iter->value, flags)) binding = iter->value; + else if ((flags & LOOKUP_PREFER_TYPES) + && qualify_lookup (iter->type, flags)) + binding = iter->type; else binding = NULL_TREE; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1e682b96fd8..9f9a932e15a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2013-08-09 Paolo Carlini + + Revert: + 2013-08-07 Paolo Carlini + + PR c++/46206 + * g++.dg/lookup/typedef2.C: New. + 2013-08-09 James Greenhalgh * gcc.target/aarch64/scalar_intrinsics.c: Update expected diff --git a/gcc/testsuite/g++.dg/lookup/typedef2.C b/gcc/testsuite/g++.dg/lookup/typedef2.C deleted file mode 100644 index fdadeec63bf..00000000000 --- a/gcc/testsuite/g++.dg/lookup/typedef2.C +++ /dev/null @@ -1,30 +0,0 @@ -// PR c++/46206 - -class Foo1 -{ - int u, v, w, x; - typedef struct Bar { } Bar; - virtual void foo(void) { - struct Bar bar; - } -}; - -class Foo2 -{ - int u, v, w; - typedef struct Bar { } Bar; - Bar bar; - virtual void foo(void) { - struct Bar bar; - } -}; - -class Foo3 -{ - int u, v, w; - typedef struct Bar { } Bar; - int Bar; // { dg-error "conflicts" } - virtual void foo(void) { - struct Bar bar; - } -};