Committed with Richard's review comments in mind in r187715.

On Sun, Aug 4, 2013 at 5:35 PM, Richard Smith <[email protected]> wrote:

> LGTM
>
> On 4 Aug 2013 00:31, "David Majnemer" <[email protected]> wrote:
> >
> > 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.
> >
> > http://llvm-reviews.chandlerc.com/D1283
> >
> > Files:
> >   lib/Sema/SemaExpr.cpp
> >   test/SemaCXX/PR16709.cpp
> >
> > Index: lib/Sema/SemaExpr.cpp
> > ===================================================================
> > --- lib/Sema/SemaExpr.cpp
> > +++ lib/Sema/SemaExpr.cpp
> > @@ -2311,7 +2311,7 @@
> >    //     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?");
>
> This assert looks trivially impossible now. Remove?
>
> >      assert(QType->isRecordType() && "lookup done with non-record type");
> > Index: test/SemaCXX/PR16709.cpp
> > ===================================================================
> > --- /dev/null
> > +++ test/SemaCXX/PR16709.cpp
>
> Please fold this into an existing test file.
>
> > @@ -0,0 +1,13 @@
> > +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
> > +
> > +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'?}}
> > +  }
> > +};
> >
> > _______________________________________________
> > cfe-commits mailing list
> > [email protected]
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >
>
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to