Sebastian Redl wrote:
>
> Got one.
>
> struct O {
>  struct I;
> };
>
> struct O::I {
> };
>
> Crashes with:
> clang: SemaDecl.cpp:81: void 
> clang::Sema::PushDeclContext(clang::DeclContext*): Assertion 
> `getContainingDC(DC) == CurContext && "The next DeclContext should be 
> directly contained in the current one."' failed.

Great find! Note that it also happens if you change "struct O {" to 
"namespace O {".

>
> I think the assertion is simply bogus, though.

It should say "The next DeclContext should be lexically contained in the 
current one.", which is what the assertion is about.

I think a ScopedDecl should be able to give it's lexical declaration 
context, that is:

namespace A {
   void f(); // Lexically and semantically in A
}

void A::f(){} // Semantically in A but lexically in global namespace.


Thanks a lot for your help!

-Argiris
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to