[cfe-dev] Clang 3.0 Crash if first argument of a constructor is autocompleted
Jake Woods
vodurden at gmail.com
Tue Apr 19 22:00:56 PDT 2011
Using the file:
class brokenfile_t {
public:
brokenfile_t (std::);
virtual ~brokenfile_t ();
private:
/* data */
};
And the command:
clang -cc1 -fsyntax-only -code-completion-at=brokenfile.cpp:3:20 brokenfile.cpp
Causes a crash with the results:
vodurden at vodurden:~/ > clang -cc1 -fsyntax-only
-code-completion-at=brokenfile.cpp:3:20 brokenfile.cpp
clang: /home/vodurden/Downloads/clang/llvm/tools/clang/lib/Lex/PPCaching.cpp:95:
void clang::Preprocessor::AnnotatePreviousCachedTokens(const
clang::Token&): Assertion `CachedTokens[CachedLexPos-1].getLastLoc()
== Tok.getAnnotationEndLoc() && "The annotation should be until the
most recent cached token"' failed.
0 clang 0x00000000019f0d4f
1 clang 0x00000000019f188a
2 libpthread.so.0 0x00007fd7d264d2d0
3 libc.so.6 0x00007fd7d1989ab5 gsignal + 53
4 libc.so.6 0x00007fd7d198afb6 abort + 390
5 libc.so.6 0x00007fd7d1982385 __assert_fail + 245
6 clang 0x0000000000eadc1e
7 clang 0x0000000000923151
clang::Parser::TryAnnotateTypeOrScopeToken(bool) + 1281
8 clang 0x000000000092c552
clang::Parser::isDeclarationSpecifier(bool) + 178
9 clang 0x000000000092c907
clang::Parser::isConstructorDeclarator() + 503
10 clang 0x0000000000932e77
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 6951
11 clang 0x00000000009424ed
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject*) + 1261
12 clang 0x0000000000944aaf
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
unsigned int, clang::Decl*) + 1999
13 clang 0x000000000094644b
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
bool) + 4251
14 clang 0x0000000000931e4a
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 2810
15 clang 0x00000000009271df
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 95
16 clang 0x000000000092780a
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 522
17 clang 0x00000000009284b0
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 3104
18 clang 0x0000000000928a92
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
+ 130
19 clang 0x00000000009061bd clang::ParseAST(clang::Sema&, bool) + 205
20 clang 0x00000000006ae523
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 371
21 clang 0x000000000068851a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1290
22 clang 0x000000000067d44d cc1_main(char const**, char
const**, char const*, void*) + 701
23 clang 0x0000000000687250 main + 6912
24 libc.so.6 0x00007fd7d1975bfd __libc_start_main + 253
25 clang 0x000000000067cfa9
Stack dump:
0. Program arguments: clang -cc1 -fsyntax-only
-code-completion-at=brokenfile.cpp:3:20 brokenfile.cpp
1. brokenfile.cpp:3:15: at annotation token
2. brokenfile.cpp:1:1: parsing struct/union/class body 'brokenfile_t'
[1] 4315 abort clang -cc1 -fsyntax-only
-code-completion-at=brokenfile.cpp:3:20
This is with a fresh download using the instructions here:
http://clang.llvm.org/get_started.html
More information about the cfe-dev
mailing list