[LLVMbugs] [Bug 20564] New: isa<FunctionDecl>(nullptr) called inside Sema::FinalizeDeclaration on invalid

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 6 10:57:28 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20564

            Bug ID: 20564
           Summary: isa<FunctionDecl>(nullptr) called inside
                    Sema::FinalizeDeclaration on invalid
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nlewycky at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Testcase:

struct {
  static ::_S_destroy {

Crash:

nlewycky at ducttape:~/creduce$
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -std=gnu++11
-w -x c++ x.best
x.best:2:12: error: non-friend class member '_S_destroy' cannot have a
qualified name
  static ::_S_destroy {
         ~~^
x.best:2:12: error: C++ requires a type specifier for all declarations
  static ::_S_destroy {
  ~~~~~~   ^
x.best:2:12: error: no member named '_S_destroy' in the global namespace
  static ::_S_destroy {
         ~~^
x.best:2:24: error: expected expression
  static ::_S_destroy {
                       ^
x.best:2:24: error: expected '}'
x.best:2:23: note: to match this '{'
  static ::_S_destroy {
                      ^
clang: /usr/local/google/home/nlewycky/llvm/include/llvm/Support/Casting.h:95:
static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
clang::FunctionDecl; From = clang::DeclContext]: Assertion `Val && "isa<> used
on a null pointer"' failed.
0  clang           0x0000000003d33395 llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x0000000003d33612
2  clang           0x0000000003d32f9d
3  libpthread.so.0 0x00007f7b97309cb0
4  libc.so.6       0x00007f7b966414f5 gsignal + 53
5  libc.so.6       0x00007f7b96644c5b abort + 379
6  libc.so.6       0x00007f7b9663a1be
7  libc.so.6       0x00007f7b9663a262
8  clang           0x000000000117a92b
9  clang           0x0000000001155a7c
10 clang           0x00000000016e437d
11 clang           0x00000000016e029f
12 clang           0x00000000016df382
13 clang           0x0000000001799d2d
clang::Sema::FinalizeDeclaration(clang::Decl*) + 175
14 clang           0x000000000165a001
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 5783
15 clang           0x000000000165b3dd
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 3205
16 clang           0x00000000016578d2
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 7322
17 clang           0x0000000001644671
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 9095
18 clang           0x000000000162d795
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 95
19 clang           0x000000000162dcce
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 174
20 clang           0x000000000162d402
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2830
21 clang           0x000000000162c8aa
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 538
22 clang           0x0000000001625bb8 clang::ParseAST(clang::Sema&, bool, bool)
+ 393
23 clang           0x00000000010e300e clang::ASTFrontendAction::ExecuteAction()
+ 322
24 clang           0x00000000010e2b43 clang::FrontendAction::Execute() + 139
25 clang           0x00000000010ad73b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 721
26 clang           0x000000000107158c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1090
27 clang           0x000000000105eebb cc1_main(char const**, char const**, char
const*, void*) + 641
28 clang           0x000000000106bdfd main + 754
29 libc.so.6       0x00007f7b9662c78d __libc_start_main + 237
30 clang           0x000000000105d4c9
Stack dump:
0.    Program arguments:
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -std=gnu++11
-w -x c++ x.best 
1.    <eof> parser at end of file
2.    x.best:1:1: parsing struct/union/class body
Aborted (core dumped)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140806/4c3a2ac3/attachment.html>


More information about the llvm-bugs mailing list