From: paolo Date: Fri, 9 Aug 2013 12:04:19 +0000 (+0000) Subject: /cp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3dade231cb7933f9d60e0302945f13c60a7d4d56;p=thirdparty%2Fgcc.git /cp 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. /testsuite 2013-08-09 Paolo Carlini Revert: 2013-08-07 Paolo Carlini PR c++/46206 * g++.dg/lookup/typedef2.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201629 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d3709fa38ad9..fc10e9560787 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 05f048068b39..0fe024691388 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 1e682b96fd85..9f9a932e15a0 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 fdadeec63bf1..000000000000 --- 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; - } -};