[LLVMbugs] [Bug 9728] New: Code Completion breaks if attempted as first argument of a constructor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 14 17:51:02 PDT 2011


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

           Summary: Code Completion breaks if attempted as first argument
                    of a constructor
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: vodurden at gmail.com
                CC: llvmbugs at cs.uiuc.edu


class brokenfile_t {
public:
brokenfile_t (std::);
    virtual ~brokenfile_t ();

private:
    /* data */
};

Using a file like this.

And the command 
clang -cc1 -fsyntax-only -code-completion-at=brokenfile.cpp:3:20 brokenfile.cpp

causes clang to fail with the error:
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 

More information is available
https://github.com/Rip-Rip/clang_complete/issues/38#comment_997389 here.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list