[LLVMbugs] [Bug 9191] New: Assertion `SrcType->getAs<EnumType>()->getDecl()->isScoped()' in invalid C++0x code
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Feb 10 05:56:55 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=9191
Summary: Assertion
`SrcType->getAs<EnumType>()->getDecl()->isScoped()' in
invalid C++0x code
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++0x
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: chris at bubblescope.net
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
Created an attachment (id=6147)
--> (http://llvm.org/bugs/attachment.cgi?id=6147)
Asserting invalid file
The attached, invalid C++ produces an assertion when compiled with -std=c++0x.
It does not crash with c++98.
This assertion is happening on a huge portion of boost when compiled in c++0x
mode, so fixing it should hopefully help get boost working with clang's c++0x
mode.
t.cc:1:6: error: ISO C++ forbids forward references to 'enum' types
enum test_unit_type;
^
t.cc:7:6: error: expected '}'
type ;
^
t.cc:6:1: note: to match this '{'
{
^
t.cc:8:2: error: expected ';' after struct
}};
^
;
t.cc:8:2: error: expected external declaration
t.cc:12:1: error: expected '{' after base class list
template<typename UnitType>
^
t.cc:10:29: error: expected ';' after struct
struct test_case : test_unit
^
;
t.cc:14:3: warning: expression result unused [-Wunused-value]
{ static_cast<test_unit_type>(UnitType::type ); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clang: SemaCXXCast.cpp:612: TryCastResult TryStaticCast(clang::Sema&,
clang::Expr*&, clang::QualType, bool, const clang::SourceRange&, unsigned int&,
clang::CastKind&, clang::CXXCastPath&): Assertion
`SrcType->getAs<EnumType>()->getDecl()->isScoped()' failed.
0 clang 0x0000000002355a69
1 clang 0x000000000235585c
2 libpthread.so.0 0x00007f4872d748f0
3 libc.so.6 0x00007f4872063a75 gsignal + 53
4 libc.so.6 0x00007f48720675c0 abort + 384
5 libc.so.6 0x00007f487205c941 __assert_fail + 241
6 clang 0x00000000012c21c9
7 clang 0x00000000012c1d93
8 clang 0x00000000012c0718
clang::Sema::BuildCXXNamedCast(clang::SourceLocation, clang::tok::TokenKind,
clang::TypeSourceInfo*, clang::Expr*, clang::SourceRange, clang::SourceRange) +
1178
9 clang 0x00000000014c04c3
10 clang 0x00000000014bfe5c
11 clang 0x00000000014bb94a
12 clang 0x00000000014b3236
13 clang 0x00000000014a6c62
14 clang 0x00000000014a65e8
15 clang 0x00000000014b9ab8
16 clang 0x00000000014ad202
17 clang 0x00000000014a6236
18 clang 0x00000000014a2dad clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&) + 125
19 clang 0x00000000014cc67a
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 1740
20 clang 0x00000000014ce89f
clang::Sema::PerformPendingInstantiations(bool) + 341
21 clang 0x00000000012af1d6 clang::Sema::ActOnEndOfTranslationUnit()
+ 376
22 clang 0x0000000001271bd9
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 119
23 clang 0x000000000125b0e0 clang::ParseAST(clang::Sema&, bool) + 328
24 clang 0x0000000000fbf363 clang::ASTFrontendAction::ExecuteAction()
+ 263
25 clang 0x0000000001103d39 clang::CodeGenAction::ExecuteAction() +
951
26 clang 0x0000000000fbefb4 clang::FrontendAction::Execute() + 320
27 clang 0x0000000000fa659d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 751
28 clang 0x0000000000f536c5
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 858
29 clang 0x0000000000f455c9 cc1_main(char const**, char const**, char
const*, void*) + 1032
30 clang 0x0000000000f4ec2c main + 499
31 libc.so.6 0x00007f487204ec4d __libc_start_main + 253
32 clang 0x0000000000f44c39
Stack dump:
0. Program arguments: /llvmdebug/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
t.cc -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.20.1 -momit-leaf-frame-pointer -resource-dir /llvmdebug/bin/../lib/clang/2.9
-std=c++0x -ferror-limit 19 -fmessage-length 192 -fexceptions -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o t.o -x c++ t.cc
1. <eof> parser at end of file
2. t.cc:13:5: instantiating function definition 'get'
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