[LLVMbugs] [Bug 8662] New: "Try to highlight whitespace" assertion in invalid code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 22 03:06:46 PST 2010


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

           Summary: "Try to highlight whitespace" assertion in invalid
                    code
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chris at bubblescope.net
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5813)
 --> (http://llvm.org/bugs/attachment.cgi?id=5813)
Asserting testcase, with space at end of line.

The attached file leads to the following assertion. Note that the file has a
space at the end of the line -- this is necessary to get the assertion.

t.bashed.902.cc:1:27: error: expected '}'
template<template<struct{ 
                          ^
t.bashed.902.cc:1:25: note: to match this '{'
template<template<struct{ 
                        ^
t.bashed.902.cc:1:26: error: expected ';' after struct
template<template<struct{ 
                         ^
                         ;
t.bashed.902.cc:1:27: error: a non-type template parameter cannot have type
'struct <anonymous struct at t.bashed.902.cc:1:19>'
template<template<struct{ 
                          ^
t.bashed.902.cc:1:27: error: expected ',' or '>' in template-parameter-list
t.bashed.902.cc:1:27: error: expected 'class' before ''
t.bashed.902.cc:1:27: error: expected ',' or '>' in template-parameter-list
t.bashed.902.cc:1:27: warning: declaration does not declare anything
[-Wmissing-declarations]
clang: TextDiagnosticPrinter.cpp:144: void
clang::TextDiagnosticPrinter::HighlightRange(const clang::CharSourceRange&,
const clang::SourceManager&, unsigned int, clang::FileID, std::string&, const
std::string&): Assertion `StartColNo <= EndColNo && "Trying to highlight
whitespace??"' failed.
0  clang           0x00000000016a2fcf
1  clang           0x00000000016a5242
2  libpthread.so.0 0x00007fbaf25c88f0
3  libc.so.6       0x00007fbaf18b7a75 gsignal + 53
4  libc.so.6       0x00007fbaf18bb5c0 abort + 384
5  libc.so.6       0x00007fbaf18b0941 __assert_fail + 241
6  clang           0x00000000006896ba
clang::TextDiagnosticPrinter::HighlightRange(clang::CharSourceRange const&,
clang::SourceManager const&, unsigned int, clang::FileID, std::string&,
std::string const&) + 1370
7  clang           0x000000000068a858
clang::TextDiagnosticPrinter::EmitCaretDiagnostic(clang::SourceLocation,
clang::CharSourceRange*, unsigned int, clang::SourceManager const&,
clang::FixItHint const*, unsigned int, unsigned int, unsigned int, unsigned
int, unsigned int) + 3928
8  clang           0x000000000068bdad
clang::TextDiagnosticPrinter::HandleDiagnostic(clang::Diagnostic::Level,
clang::DiagnosticInfo const&) + 2093
9  clang           0x0000000000d1d89b clang::Diagnostic::ProcessDiag() + 523
10 clang           0x0000000000d1da2d clang::DiagnosticBuilder::Emit() + 29
11 clang           0x00000000008ecd6d
clang::Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() + 173
12 clang           0x000000000094f2e8
clang::Sema::ParsedFreeStandingDeclSpec(clang::Scope*, clang::AccessSpecifier,
clang::DeclSpec&) + 408
13 clang           0x00000000008dca41
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier) + 1825
14 clang           0x00000000008df0d5
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 693
15 clang           0x00000000008bc619
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&, clang::CXX0XAttributeList) + 409
16 clang           0x00000000008b2a53
clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList,
clang::Parser::ParsingDeclSpec*) + 1091
17 clang           0x00000000008b2c92
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 114
18 clang           0x000000000089afcb clang::ParseAST(clang::Sema&, bool) + 139
19 clang           0x000000000076da24 clang::CodeGenAction::ExecuteAction() +
68
20 clang           0x0000000000667b95
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 357
21 clang           0x00000000006476dc
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1276
22 clang           0x000000000063f595 cc1_main(char const**, char const**, char
const*, void*) + 629
23 clang           0x0000000000646697 main + 4087
24 libc.so.6       0x00007fbaf18a2c4d __libc_start_main + 253
25 clang           0x000000000063dce9
Stack dump:
0.      Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
t.bashed.902.cc -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.20.1 -resource-dir /usr/local/bin/../lib/clang/2.9 -ferror-limit 19
-fmessage-length 0 -fexceptions -fgnu-runtime -fdiagnostics-show-option -o
t.bashed.902.o -x c++ t.bashed.902.cc 
1.      <eof> parser at end of file
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

-- 
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