Sema::PerformObjectMemberConversion assumed that the Qualifier it was
given holds a type. However, the specifier could hold just a namespace.
In this case, we should ignore the qualifier and not attempt to cast to
it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187715
91177308-0d34-0410-b5e6-
96231b3b80d8
// x = 17; // error: ambiguous base subobjects
// Derived1::x = 17; // okay, pick the Base subobject of Derived1
// }
- if (Qualifier) {
+ if (Qualifier && Qualifier->getAsType()) {
QualType QType = QualType(Qualifier->getAsType(), 0);
- assert(!QType.isNull() && "lookup done with dependent qualifier?");
assert(QType->isRecordType() && "lookup done with non-record type");
QualType QRecordType = QualType(QType->getAs<RecordType>(), 0);
// FIXME: Typo correction should remove the 'gatekeeper_v1::' name specifier
gatekeeper_v1::closure_t *x; // expected-error-re {{no type named 'closure_t' in namespace 'gatekeeper_v1'$}}
}
+
+namespace Foo {
+struct Base {
+ void Bar() {} // expected-note{{'Bar' declared here}}
+};
+}
+
+struct Derived : public Foo::Base {
+ void test() {
+ Foo::Bar(); // expected-error{{no member named 'Bar' in namespace 'Foo'; did you mean simply 'Bar'?}}
+ }
+};