[LLVMbugs] [Bug 15629] New: clang::Expr::setType() Assertion failed: "Expressions can't have reference type"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 29 21:54:17 PDT 2013


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

            Bug ID: 15629
           Summary: clang::Expr::setType() Assertion failed: "Expressions
                    can't have reference type"
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tim.schier at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10258
  --> http://llvm.org/bugs/attachment.cgi?id=10258&action=edit
preprocessed source and run script

Note: no suggestion that the source code should compile correctly; just that
the compile shouldn't crash.


See attached for preprocessed source code, and run script.

Compile crash backtrace:


/bin/sh -c 'make -e -f  "TimsTrials_wsp.mk"'
----------Building project:[ Lexer - Debug ]----------
make[1]: Entering directory `/home/tim/Ubuntu One/ABC/Lexemer'
codelitegcc clang++  -c  "/home/tim/Ubuntu One/ABC/Lexemer/lexer.cpp"
-std=c++11 -g -O0 -Wall  -o ./Debug/lexer.o -I. -I.
clang:
/home/tim/src/llvm/tools/clang/lib/Sema/../../include/clang/AST/Expr.h:131:
void clang::Expr::setType(clang::QualType): Assertion `(t.isNull() ||
!t->isReferenceType()) && "Expressions can't have reference type"' failed.
0  clang           0x0000000001cadebf
1  clang           0x0000000001cae3d9
2  libpthread.so.0 0x00002abd48282cb0
3  libc.so.6       0x00002abd48ee1425 gsignal + 53
4  libc.so.6       0x00002abd48ee4b8b abort + 379
5  libc.so.6       0x00002abd48eda0ee
6  libc.so.6       0x00002abd48eda192
7  clang           0x000000000062a2b4
8  clang           0x0000000000bcb1e5
9  clang           0x0000000000b8b9ab
clang::Sema::BuildCompoundLiteralExpr(clang::SourceLocation,
clang::TypeSourceInfo*, clang::SourceLocation, clang::Expr*) + 1003
10 clang           0x0000000000b8ba4f
clang::Sema::ActOnCompoundLiteral(clang::SourceLocation,
clang::OpaquePtr<clang::QualType>, clang::SourceLocation, clang::Expr*) + 79
11 clang           0x0000000000a22327
clang::Parser::ParseCompoundLiteralExpression(clang::OpaquePtr<clang::QualType>,
clang::SourceLocation, clang::SourceLocation) + 103
12 clang           0x0000000000a237b0
clang::Parser::ParseParenExpression(clang::Parser::ParenParseOption&, bool,
bool, clang::OpaquePtr<clang::QualType>&, clang::SourceLocation&) + 5072
13 clang           0x0000000000a1e21a clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 1562
14 clang           0x0000000000a1febd clang::Parser::ParseCastExpression(bool,
bool, clang::Parser::TypeCastState) + 29
15 clang           0x0000000000a2131f
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 31
16 clang           0x00000000009fd191
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&) + 513
17 clang           0x0000000000a078a3
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 435
18 clang           0x0000000000a0a03c
clang::Parser::ParseSimpleDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*)
+ 780
19 clang           0x0000000000a0a203
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 147
20 clang           0x0000000000a4e4b8
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 280
21 clang           0x0000000000a4ebcd
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 141
22 clang           0x0000000000a4c4c7
clang::Parser::ParseCompoundStatementBody(bool) + 1879
23 clang           0x0000000000a52f0d
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 141
24 clang           0x00000000009f7c09
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
1097
25 clang           0x0000000000a07b94
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1188
26 clang           0x00000000009f20a8
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 248
27 clang           0x00000000009f257c
28 clang           0x00000000009f268f
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 31
29 clang           0x00000000009f4bf6
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 134
30 clang           0x00000000009f5213
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 195
31 clang           0x00000000009f052f clang::ParseAST(clang::Sema&, bool, bool)
+ 271
32 clang           0x00000000008a529e clang::CodeGenAction::ExecuteAction() +
78
33 clang           0x0000000000745f76 clang::FrontendAction::Execute() + 150
34 clang           0x000000000072949d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 349
35 clang           0x0000000000710bed
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1437
36 clang           0x000000000070a638 cc1_main(char const**, char const**, char
const*, void*) + 1000
37 clang           0x00000000006ff3af main + 4831
38 libc.so.6       0x00002abd48ecc76d __libc_start_main + 237
39 clang           0x00000000007095e9
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
lexer.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -target-linker-version 2.22.90.20120924
-momit-leaf-frame-pointer -g -coverage-file /home/tim/Ubuntu
One/ABC/Lexemer/./Debug/lexer.o -resource-dir /usr/local/bin/../lib/clang/3.2
-I . -I . -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.2/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O0 -Wall -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/tim/Ubuntu One/ABC/Lexemer -ferror-limit 19
-fmessage-length 0 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -o ./Debug/lexer.o -x c++
/home/tim/Ubuntu One/ABC/Lexemer/lexer.cpp
1.    /home/tim/Ubuntu One/ABC/Lexemer/lexer.cpp:33:53: current parser token
';'
2.    /home/tim/Ubuntu One/ABC/Lexemer/lexer.cpp:24:1: parsing function body
'main'
3.    /home/tim/Ubuntu One/ABC/Lexemer/lexer.cpp:24:1: in compound statement
('{}')
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.2 (tags/RELEASE_32/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/lexer-2yFhj8.cpp
clang: note: diagnostic msg: /tmp/lexer-2yFhj8.sh
clang: note: diagnostic msg:

********************
make[1]: *** [Debug/lexer.o] Error 254
make[1]: Leaving directory `/home/tim/Ubuntu One/ABC/Lexemer'
make: *** [All] Error 2
1 errors, 0 warnings

-- 
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/20130330/a1d294a2/attachment.html>


More information about the llvm-bugs mailing list