[LLVMbugs] [Bug 11726] New: Assertion with -Wlarge-by-value-copy and unknown type in template
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Jan 8 22:17:28 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=11726
Bug #: 11726
Summary: Assertion with -Wlarge-by-value-copy and unknown type
in template
Product: clang
Version: trunk
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: laurie_llvmbugzilla at intrepid-geophysics.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
This code generates an assertion when compiled with
"/Users/loz/Projects/thirdparty/llvm_head/Release+Asserts/bin/clang"
-Wlarge-by-value-copy -x c++ parallelUtilsAll-JI3ZpQ.ii:
template<T> class a
{
enum b
{
x
};
b foo()
{
return x;
}
};
The real code was in Intel TBB, version 3.0.20110315, in tbb_allocator.h, but I
minimised it to the above using the delta tool (delta.tigris.org).
Here is the assertion, using svn revision 147764:
parallelUtilsAll-JI3ZpQ.ii:1:10: error: unknown type name 'T'
template<T> class a
^
Unknown builtin type!
UNREACHABLE executed at ASTContext.cpp:879!
0 clang 0x0000000110eaf922 _ZL15PrintStackTracePv + 34
1 clang 0x0000000110eaff19 _ZL13SignalHandleri + 777
2 libsystem_c.dylib 0x00007fff858e2cfa _sigtramp + 26
3 clang 0x00000001102a5fad llvm::DenseMap<clang::DeclarationName,
clang::StoredDeclsList, llvm::DenseMapInfo<clang::DeclarationName>,
llvm::DenseMapInfo<clang::StoredDeclsList>
>::InsertIntoBucket(clang::DeclarationName const&, clang::StoredDeclsList
const&, std::pair<clang::DeclarationName, clang::StoredDeclsList>*) + 413
4 clang 0x0000000110eafb66 abort + 22
5 clang 0x0000000110e9f314 llvm::llvm_unreachable_internal(char
const*, char const*, unsigned int) + 468
6 clang 0x000000011024c0c6
clang::ASTContext::getTypeInfo(clang::Type const*) const + 518
7 clang 0x000000011024c440
clang::ASTContext::getTypeInfo(clang::Type const*) const + 1408
8 clang 0x000000011024c9ef
clang::ASTContext::getTypeSizeInChars(clang::QualType) const + 31
9 clang 0x000000010fdcf491
clang::Sema::DiagnoseSizeOfParametersAndReturnValue(clang::ParmVarDecl* const*,
clang::ParmVarDecl* const*, clang::QualType, clang::NamedDecl*) + 81
10 clang 0x000000010fdd0b2d
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 365
11 clang 0x000000010fd14404
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 244
12 clang 0x000000010fcca366
clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) + 534
13 clang 0x000000010fcc9c24
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 132
14 clang 0x000000010fce3b32
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int,
clang::Decl*) + 3154
15 clang 0x000000010fce28ff
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, bool) + 4879
16 clang 0x000000010fcd1029
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 5625
17 clang 0x000000010fd15cf5
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier, clang::AttributeList*) + 645
18 clang 0x000000010fd157fa
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 954
19 clang 0x000000010fd1533d
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 477
20 clang 0x000000010fccf3a9
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 537
21 clang 0x000000010fd1f49a
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1738
22 clang 0x000000010fd1ed59
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 249
23 clang 0x000000010fcc828b clang::ParseAST(clang::Sema&, bool) +
283
24 clang 0x000000010fc95796 clang::CodeGenAction::ExecuteAction() +
1062
25 clang 0x000000010fa88122
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 978
26 clang 0x000000010fa6f0b8
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2776
27 clang 0x000000010fa666b7 cc1_main(char const**, char const**,
char const*, void*) + 5495
28 clang 0x000000010fa6b452 main + 706
29 clang 0x000000010fa65134 start + 52
Stack dump:
0. Program arguments:
/Users/loz/Projects/thirdparty/llvm_head/Release+Asserts/bin/clang -cc1 -triple
x86_64-apple-macosx10.7.2 -emit-obj -mrelax-all -disable-free -main-file-name
parallelUtilsAll-JI3ZpQ.ii -pic-level 1 -mdisable-fp-elim -masm-verbose
-munwind-tables -target-cpu core2 -target-linker-version 127.2 -resource-dir
/Users/loz/Projects/thirdparty/llvm_head/Release+Asserts/bin/../lib/clang/3.1
-fmodule-cache-path
/var/folders/mg/9ts97qln017gnyp6fh1ts6380000gr/T/clang-module-cache
-fdeprecated-macro -fdebug-compilation-dir /Users/loz/deltasample
-Wlarge-by-value-copy 64 -ferror-limit 19 -fmessage-length 263 -stack-protector
1 -mstackrealign -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak
-fobjc-dispatch-method=mixed -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/mg/9ts97qln017gnyp6fh1ts6380000gr/T/parallelUtilsAll-JI3ZpQ-A2UJWb.o
-x c++ parallelUtilsAll-JI3ZpQ.ii
1. parallelUtilsAll-JI3ZpQ.ii:11:2: current parser token ';'
2. parallelUtilsAll-JI3ZpQ.ii:1:13: parsing struct/union/class body 'a'
3. parallelUtilsAll-JI3ZpQ.ii:8:3: parsing function body 'foo'
clang: error: unable to execute command: Illegal instruction: 4
--
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