[cfe-commits] r152609 - in /cfe/trunk/lib: AST/DeclBase.cpp Sema/SemaLookup.cpp Serialization/ASTWriter.cpp

Eli Friedman eli.friedman at gmail.com
Thu Mar 15 18:08:33 PDT 2012


On Mon, Mar 12, 2012 at 9:12 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
> Author: nicholas
> Date: Mon Mar 12 23:12:34 2012
> New Revision: 152609
>
> URL: http://llvm.org/viewvc/llvm-project?rev=152609&view=rev
> Log:
> It never makes sense to do a lookup into a LinkageSpecDecl, so assert that we
> don't, and clean up the places that do it.
>
> The change to ASTWriter is surprising, but the deleted code is a no-op as of
> r152608.
>
> Modified:
>    cfe/trunk/lib/AST/DeclBase.cpp
>    cfe/trunk/lib/Sema/SemaLookup.cpp
>    cfe/trunk/lib/Serialization/ASTWriter.cpp
>
> Modified: cfe/trunk/lib/AST/DeclBase.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=152609&r1=152608&r2=152609&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/DeclBase.cpp (original)
> +++ cfe/trunk/lib/AST/DeclBase.cpp Mon Mar 12 23:12:34 2012
> @@ -1084,6 +1084,9 @@
>
>  DeclContext::lookup_result
>  DeclContext::lookup(DeclarationName Name) {
> +  assert(DeclKind != Decl::LinkageSpec &&
> +         "Should not perform lookups into linkage specs!");

I'm seeing this assertion on g++.dg/parse/friend5.C from the gcc testsuite:

extern "C" struct A
{
  friend void foo(int) {} // { dg-error "declaration" }
  friend void foo() {} // { dg-error "foo" }
};

-Eli




More information about the cfe-commits mailing list