[LLVMbugs] [Bug 16765] New: crash in late parsed templates with null decl*

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 31 15:19:32 PDT 2013


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

            Bug ID: 16765
           Summary: crash in late parsed templates with null decl*
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            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

Reduced testcase:

class {
  template <> : 0 __attribute__((locks_excluded()));
};

$ clang -cc1 x.cc
x.cc:2:3: error: extraneous 'template<>' in declaration of member (null)
  template <> : 0 __attribute__((locks_excluded()));
  ^~~~~~~~~~~
clang: /usr/local/google/home/nlewycky/llvm/include/llvm/Support/Casting.h:97:
static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
clang::NamedDecl, From = clang::Decl]: Assertion `Val && "isa<> used on a null
pointer"' failed.
0  clang           0x000000000325c8e3 llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x000000000325cb6a
2  clang           0x000000000325c5ae
3  libpthread.so.0 0x00007f8553766cb0
4  libc.so.6       0x00007f85529b8425 gsignal + 53
5  libc.so.6       0x00007f85529bbb8b abort + 379
6  libc.so.6       0x00007f85529b10ee
7  libc.so.6       0x00007f85529b1192
8  clang           0x0000000000d41758
9  clang           0x0000000000d416ab
10 clang           0x0000000000d4153c
11 clang           0x0000000000d41407 bool llvm::isa<clang::NamedDecl,
clang::Decl*>(clang::Decl* const&) + 24
12 clang           0x0000000000d411dc llvm::cast_retty<clang::NamedDecl,
clang::Decl*>::ret_type llvm::dyn_cast<clang::NamedDecl,
clang::Decl>(clang::Decl*) + 24
13 clang           0x00000000011e8abd
clang::Parser::ParseLexedAttribute(clang::Parser::LateParsedAttribute&, bool,
bool) + 613
14 clang           0x00000000011e855e
clang::Parser::LateParsedAttribute::ParseLexedAttributes() + 42
15 clang           0x00000000011e86c9
clang::Parser::ParseLexedAttributes(clang::Parser::ParsingClass&) + 361
16 clang           0x00000000012073c9
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 3301
17 clang           0x00000000012037f1
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 8275
18 clang           0x00000000011ef2a5
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 8343
19 clang           0x00000000011d85a7
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 101
20 clang           0x00000000011d8a41
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 189
21 clang           0x00000000011d81f5
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2783
22 clang           0x00000000011d76e5
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 415
23 clang           0x00000000011d3d27 clang::ParseAST(clang::Sema&, bool, bool)
+ 387
24 clang           0x0000000000d9e047 clang::ASTFrontendAction::ExecuteAction()
+ 321
25 clang           0x0000000000fdc1f4 clang::CodeGenAction::ExecuteAction() +
1414
26 clang           0x0000000000d9db86 clang::FrontendAction::Execute() + 200
27 clang           0x0000000000d70016
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
28 clang           0x0000000000d3f1be
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1018
29 clang           0x0000000000d308a5 cc1_main(char const**, char const**, char
const*, void*) + 717
30 clang           0x0000000000d3aefd main + 551
31 libc.so.6       0x00007f85529a376d __libc_start_main + 237
32 clang           0x0000000000d2ff79
0.      Program arguments:
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
x.cc -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.22 -resource-dir
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.4
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6
-internal-isystem /usr/local/include -internal-isystem
/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/../lib/clang/3.4/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /usr/local/google/home/nlewycky
-ferror-limit 19 -fmessage-length 80 -mstackrealign -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -o
/tmp/x-ee6b56.o -x c++ x.cc 
1.      x.cc:2:48: current parser token '('
2.      x.cc:1:1: parsing struct/union/class body
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (trunk 187531)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
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/20130731/c1480257/attachment.html>


More information about the llvm-bugs mailing list