[LLVMbugs] [Bug 14997] New: Deleting copy-assignment in struct nested in union template crashes clang.
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Jan 18 15:56:26 PST 2013
http://llvm.org/bugs/show_bug.cgi?id=14997
Bug #: 14997
Summary: Deleting copy-assignment in struct nested in union
template crashes clang.
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: peter.goodman at gmail.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 9889
--> http://llvm.org/bugs/attachment.cgi?id=9889
Example source code that produces bug.
Deleting a copy assignment operator in structure nested inside of a union
template partial specialization.
This might be illegal C++ (and there is a simple workaround), but it crashes
clang++.
clang version 3.3 (trunk 172567) (llvm/trunk 172566)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Stack reported by clang:
clang: /home/pag/Code/llvm/tools/clang/lib/Sema/SemaLookup.cpp:2230:
clang::Sema::SpecialMemberOverloadResult*
clang::Sema::LookupSpecialMember(clang::CXXRecordDecl*,
clang::Sema::CXXSpecialMember, bool, bool, bool, bool, bool): Assertion
`CanDeclareSpecialMemberFunction(RD) && "doing special member lookup into
record that isn't fully complete"' failed.
0 clang 0x0000000001d44ba2 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1 clang 0x0000000001d447f9
2 libpthread.so.0 0x00007f56de2c7cb0
3 libc.so.6 0x00007f56dd516425 gsignal + 53
4 libc.so.6 0x00007f56dd519b8b abort + 379
5 libc.so.6 0x00007f56dd50f0ee
6 libc.so.6 0x00007f56dd50f192
7 clang 0x0000000000c4a7c1
clang::Sema::LookupSpecialMember(clang::CXXRecordDecl*,
clang::Sema::CXXSpecialMember, bool, bool, bool, bool, bool) + 1569
8 clang 0x0000000000b81c3c
9 clang 0x0000000000b81edc
10 clang 0x0000000000b82f65
clang::Sema::DiagnoseNontrivial(clang::CXXRecordDecl const*,
clang::Sema::CXXSpecialMember) + 85
11 clang 0x0000000000b0e9c7
clang::Sema::CheckNontrivialField(clang::FieldDecl*) + 471
12 clang 0x0000000000b17fec
clang::Sema::CheckFieldDecl(clang::DeclarationName, clang::QualType,
clang::TypeSourceInfo*, clang::RecordDecl*, clang::SourceLocation, bool,
clang::Expr*, clang::InClassInitStyle, clang::SourceLocation,
clang::AccessSpecifier, clang::NamedDecl*, clang::Declarator*) + 796
13 clang 0x0000000000b18776 clang::Sema::HandleField(clang::Scope*,
clang::RecordDecl*, clang::SourceLocation, clang::Declarator&, clang::Expr*,
clang::InClassInitStyle, clang::AccessSpecifier) + 662
14 clang 0x0000000000b74567
clang::Sema::ActOnCXXMemberDeclarator(clang::Scope*, clang::AccessSpecifier,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
clang::Expr*, clang::VirtSpecifiers const&, clang::InClassInitStyle) + 887
15 clang 0x0000000000a387e4
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 3908
16 clang 0x0000000000a39f9c
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::ParsedAttributes&, unsigned int, clang::Decl*) +
1660
17 clang 0x0000000000a3ba96
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 3894
18 clang 0x0000000000a23dec
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 4748
19 clang 0x0000000000a7acc7
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 951
20 clang 0x0000000000a7c04f
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 719
21 clang 0x0000000000a7c52e
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 158
22 clang 0x0000000000a2b501
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 545
23 clang 0x0000000000a15953
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 467
24 clang 0x0000000000a15e13
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 195
25 clang 0x0000000000a114bb clang::ParseAST(clang::Sema&, bool, bool)
+ 267
26 clang 0x00000000008c2d91 clang::CodeGenAction::ExecuteAction() +
97
27 clang 0x000000000075bf46 clang::FrontendAction::Execute() + 150
28 clang 0x000000000073f22d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 349
29 clang 0x00000000007269a2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1442
30 clang 0x00000000007200b8 cc1_main(char const**, char const**, char
const*, void*) + 984
31 clang 0x0000000000714b78 main + 4936
32 libc.so.6 0x00007f56dd50176d __libc_start_main + 237
33 clang 0x000000000071f079
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
bug.cc -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 -resource-dir
/usr/local/bin/../lib/clang/3.3 -fmodule-cache-path /var/tmp/clang-module-cache
-internal-isystem /usr/include/c++/v1 -internal-isystem /usr/local/include
-internal-isystem /usr/local/bin/../lib/clang/3.3/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/pag/Code/RCU
-ferror-limit 19 -fmessage-length 108 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-backend-option -vectorize-loops -o /tmp/bug-UoSft2.o -x c++ bug.cc
1. bug.cc:38:11: current parser token ';'
2. bug.cc:10:1: parsing struct/union/class body 'field_accessor'
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.3 (trunk 172567) (llvm/trunk 172566)
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/bug-ZKAnrN.cpp
clang: note: diagnostic msg: /tmp/bug-ZKAnrN.sh
clang: note: diagnostic msg:
********************
--
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