Open Quuxplusone opened 12 years ago
Bugzilla Link | PR14449 |
Status | NEW |
Importance | P enhancement |
Reported by | Craig Schroeder (snubdodecahedron@gmail.com) |
Reported on | 2012-11-28 16:39:51 -0800 |
Last modified on | 2018-05-08 06:20:06 -0700 |
Version | trunk |
Hardware | PC Linux |
CC | dgregor@apple.com, efriedma@quicinc.com, llvm-bugs@lists.llvm.org, rafael@espindo.la, vegard.nossum@gmail.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
I can't reproduce this with trunk clang.
Alternative test case that crashes on current trunk (as opposed to the original
test case):
struct t {
void m_fn1() {
struct {
void x(t) { decltype(x):: }
}
}
}
Output:
$ clang++ -x c++ -c -
<stdin>:4:28: error: reference to non-static member function must be called
void x(t) { decltype(x):: }
^
clang-7: /home/vegard/llvm/tools/clang/include/clang/AST/Type.h:669: const
clang::ExtQualsTypeCommonBase* clang::QualType::getCommonPtr() const: Assertion
`!isNull() && "Cannot retrieve a NULL type pointer"' failed.
Stack dump:
0. Program arguments: /home/vegard/llvm-build/bin/clang-7 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name - -
mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -
masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu
x86-64 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file
/home/vegard/creduce/-.gcno -resource-dir /home/vegard/llvm-
build/lib/clang/7.0.0 -internal-isystem /usr/lib/gcc/x86_64-linux-
gnu/7.2.0/../../../../include/c++ -internal-isystem /usr/lib/gcc/x86_64-linux-
gnu/7.2.0/../../../../include/c++/x86_64-linux-gnu -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/backward -internal-
isystem /usr/local/include -internal-isystem /home/vegard/llvm-
build/lib/clang/7.0.0/include -internal-externc-isystem /usr/include/x86_64-
linux-gnu -internal-externc-isystem /include -internal-externc-isystem
/usr/include -fdeprecated-macro -fdebug-compilation-dir /home/vegard/creduce -
ferror-limit 19 -fmessage-length 207 -fobjc-runtime=gcc -fcxx-exceptions -
fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o -.o -x c++ -
1. <stdin>:4:33: current parser token '}'
2. <stdin>:1:1: parsing struct/union/class body 't'
3. <stdin>:2:16: parsing function body 't::m_fn1'
4. <stdin>:2:16: in compound statement ('{}')
5. <stdin>:3:5: parsing struct/union/class body ''
6. <stdin>:4:17: parsing function body 't::m_fn1()::(anonymous struct)::x'
7. <stdin>:4:17: in compound statement ('{}')
#0 0x0000000008da8742 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/vegard/llvm/lib/Support/Unix/Signals.inc:403:0
#1 0x0000000008d9e6f2 llvm::sys::RunSignalHandlers()
/home/vegard/llvm/lib/Support/Signals.cpp:50:0
#2 0x0000000008d9eea9 SignalHandler(int)
/home/vegard/llvm/lib/Support/Unix/Signals.inc:243:0
#3 0x00007f701ad98390 __restore_rt (/lib/x86_64-linux-
gnu/libpthread.so.0+0x11390)
#4 0x00007f7019b03428 gsignal /build/glibc-Cl5G7W/glibc-
2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f7019b0502a abort /build/glibc-Cl5G7W/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f7019afbbd7 __assert_fail_base /build/glibc-Cl5G7W/glibc-
2.23/assert/assert.c:92:0
#7 0x00007f7019afbc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x000000000f550c57 llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul,
4096ul>::Allocate(unsigned long, unsigned long)
/home/vegard/llvm/tools/clang/include/clang/AST/Type.h:669:0
#9 0x000000000f550c57 clang::ASTContext::Allocate(unsigned long, unsigned int)
const /home/vegard/llvm/tools/clang/include/clang/AST/ASTContext.h:651:0
#10 0x000000000f550c57
clang::TypeLocBuilder::getTypeLocInContext(clang::ASTContext&, clang::QualType)
/home/vegard/llvm/tools/clang/lib/Sema/TypeLocBuilder.h:123:0
#11 0x000000000f550c57
clang::Sema::ActOnCXXNestedNameSpecifierDecltype(clang::CXXScopeSpec&,
clang::DeclSpec const&, clang::SourceLocation)
/home/vegard/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp:858:0
#12 0x000000000eb120d2
clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::QualType>, bool, bool*, bool, clang::IdentifierInfo**,
bool) /home/vegard/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp:230:0
#13 0x000000000e9e6219 clang::Parser::TryAnnotateTypeOrScopeToken()
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:1761:0
#14 0x000000000ec19e3c
clang::Parser::isCXXDeclarationSpecifier(clang::Parser::TPResult, bool*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseTentative.cpp:1307:0
#15 0x000000000ec22a4f clang::Parser::isCXXSimpleDeclaration(bool)
/home/vegard/llvm/tools/clang/lib/Parse/ParseTentative.cpp:117:0
#16 0x000000000ebb9b4c clang::Parser::isDeclarationStatement()
/home/vegard/llvm/tools/clang/include/clang/Parse/Parser.h:2012:0
#17 0x000000000ebb9b4c
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedConstructsKind, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:212:0
#18 0x000000000ebb9f7e
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedConstructsKind, clang::SourceLocation*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:111:0
#19 0x000000000ebc587f clang::Parser::ParseCompoundStatementBody(bool)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1003:0
#20 0x000000000ebccb40 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1975:0
#21 0x000000000e9eea4f clang::Token::isNot(clang::tok::TokenKind) const
/home/vegard/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:551:0
#22 0x000000000e9eea4f
clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:553:0
#23 0x000000000e9edf1e
llvm::SmallVectorTemplateCommon<clang::Parser::LateParsedDeclaration*,
void>::begin() const /home/vegard/llvm/include/llvm/ADT/SmallVector.h:118:0
#24 0x000000000e9edf1e
llvm::SmallVectorTemplateCommon<clang::Parser::LateParsedDeclaration*,
void>::size() const /home/vegard/llvm/include/llvm/ADT/SmallVector.h:136:0
#25 0x000000000e9edf1e
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:478:0
#26 0x000000000eaafd11
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) /home/vegard/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:3310:0
#27 0x000000000eab749d
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:1915:0
#28 0x000000000ea3e3a4
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:3675:0
#29 0x000000000ea6038e
clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool,
clang::Parser::ForRangeInit*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1746:0
#30 0x000000000ea61410
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1696:0
#31 0x000000000ebb9aed
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedConstructsKind, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:216:0
#32 0x000000000ebb9f7e
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedConstructsKind, clang::SourceLocation*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:111:0
#33 0x000000000ebc587f clang::Parser::ParseCompoundStatementBody(bool)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1003:0
#34 0x000000000ebccb40 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1975:0
#35 0x000000000e9eea4f clang::Token::isNot(clang::tok::TokenKind) const
/home/vegard/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:551:0
#36 0x000000000e9eea4f
clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:553:0
#37 0x000000000e9edf1e
llvm::SmallVectorTemplateCommon<clang::Parser::LateParsedDeclaration*,
void>::begin() const /home/vegard/llvm/include/llvm/ADT/SmallVector.h:118:0
#38 0x000000000e9edf1e
llvm::SmallVectorTemplateCommon<clang::Parser::LateParsedDeclaration*,
void>::size() const /home/vegard/llvm/include/llvm/ADT/SmallVector.h:136:0
#39 0x000000000e9edf1e
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:478:0
#40 0x000000000eaafd11
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) /home/vegard/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:3310:0
#41 0x000000000eab749d
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:1915:0
#42 0x000000000ea3e3a4
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
/home/vegard/llvm/tools/clang/lib/Parse/ParseDecl.cpp:3675:0
#43 0x000000000e9cbe68
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:927:0
#44 0x000000000e9cdd91
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.168.constprop.192)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:1028:0
#45 0x000000000e9cded7
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:1030:0
#46 0x000000000e9dff74
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:853:0
#47 0x000000000e9e3529 _ZN5clang13AttributePoolD4Ev
/home/vegard/llvm/tools/clang/include/clang/Sema/AttributeList.h:642:0
#48 0x000000000e9e3529 _ZN5clang16ParsedAttributesD4Ev
/home/vegard/llvm/tools/clang/include/clang/Sema/AttributeList.h:755:0
#49 0x000000000e9e3529 _ZN5clang6Parser25ParsedAttributesWithRangeD4Ev
/home/vegard/llvm/tools/clang/include/clang/Parse/Parser.h:1308:0
#50 0x000000000e9e3529
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:606:0
#51 0x000000000e9e4e78
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/vegard/llvm/tools/clang/lib/Parse/Parser.cpp:536:0
#52 0x000000000e9baa78 clang::ParseAST(clang::Sema&, bool, bool)
/home/vegard/llvm/tools/clang/lib/Parse/ParseAST.cpp:151:0
#53 0x000000000c01df2c clang::CodeGenAction::ExecuteAction()
/home/vegard/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1044:0
#54 0x000000000aecb7d6 clang::FrontendAction::Execute()
/home/vegard/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:904:0
#55 0x000000000ad5d2c8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/vegard/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:990:0
#56 0x000000000b2dc498
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/vegard/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:256:0
#57 0x0000000000e993f8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /home/vegard/llvm/tools/clang/tools/driver/cc1_main.cpp:222:0
#58 0x0000000000de2539 ExecuteCC1Tool
/home/vegard/llvm/tools/clang/tools/driver/driver.cpp:310:0
#59 0x0000000000de2539 main
/home/vegard/llvm/tools/clang/tools/driver/driver.cpp:382:0
#60 0x00007f7019aee830 __libc_start_main /build/glibc-Cl5G7W/glibc-
2.23/csu/../csu/libc-start.c:325:0
#61 0x0000000000e7e1f9 _start (/home/vegard/llvm-build/bin/clang-7+0xe7e1f9)
clang-7: error: unable to execute command: Aborted
clang-7: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (https://github.com/llvm-mirror/clang
fd84b47426fa82c78ca25ba20cf37fc9b0f42586) (https://github.com/llvm-mirror/llvm
e1b4442d3ffc378f4a48dd0bfeb2b0876b116e2f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/vegard/llvm-build/bin