+2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/46206
+ * name-lookup.c (lookup_name_real_1): Handle iter->type before
+ iter->value.
+
2013-08-06 Caroline Tice <cmtice@google.com>
* Make-lang.in (*CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
continue;
/* If this is the kind of thing we're looking for, we're done. */
- if (qualify_lookup (iter->value, flags))
- binding = iter->value;
- else if ((flags & LOOKUP_PREFER_TYPES)
- && qualify_lookup (iter->type, flags))
+ if ((flags & LOOKUP_PREFER_TYPES)
+ && qualify_lookup (iter->type, flags))
binding = iter->type;
+ else if (qualify_lookup (iter->value, flags))
+ binding = iter->value;
else
binding = NULL_TREE;
+2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/46206
+ * g++.dg/lookup/typedef2.C: New.
+
2013-08-07 David Malcolm <dmalcolm@redhat.com>
* lib/plugin-support.exp (plugin-test-execute): Add -fno-rtti
--- /dev/null
+// 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;
+ }
+};