[LLVMbugs] [Bug 19171] New: Crash when clang suggest non-class typo-correction for a using decl inside class declaration
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Mar 18 02:38:01 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=19171
Bug ID: 19171
Summary: Crash when clang suggest non-class typo-correction for
a using decl inside class declaration
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: dinesh.d at samsung.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 12248
--> http://llvm.org/bugs/attachment.cgi?id=12248&action=edit
testcase
> clang --version
clang version 3.5.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
> clang++ -c using3.C
using3.C:11:9: error: no member named 'S' in 'S'; did you mean '::S'?
using S::S; // { dg-error "" } no such field
^~~~
::S
using3.C:8:3: note: '::S' declared here
} S;
^
clang-3.5: /home/dinesh/MyWS/llvm/git/llvm/include/llvm/Support/Casting.h:237:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X =
clang::CXXRecordDecl; Y = clang::DeclContext; typename llvm::cast_retty<X,
Y*>::ret_type = clang::CXXRecordDecl*]: Assertion `isa<X>(Val) && "cast<Ty>()
argument of incompatible type!"' failed.
0 clang-3.5 0x0000000000bbb902 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1 clang-3.5 0x0000000000bbb4e9
2 libpthread.so.0 0x00007f946ae96bd0
3 libc.so.6 0x00007f946a2d7037 gsignal + 55
4 libc.so.6 0x00007f946a2da698 abort + 328
5 libc.so.6 0x00007f946a2cfe03
6 libc.so.6 0x00007f946a2cfeb2
7 clang-3.5 0x0000000001848f70
8 clang-3.5 0x0000000001852761
9 clang-3.5 0x00000000018abf2f
clang::Sema::CheckUsingShadowDecl(clang::UsingDecl*, clang::NamedDecl*,
clang::LookupResult const&, clang::UsingShadowDecl*&) + 111
10 clang-3.5 0x00000000018b13b6
clang::Sema::BuildUsingDeclaration(clang::Scope*, clang::AccessSpecifier,
clang::SourceLocation, clang::CXXScopeSpec&, clang::DeclarationNameInfo const&,
clang::AttributeList*, bool, bool, clang::SourceLocation) + 2358
11 clang-3.5 0x00000000018b16ed
clang::Sema::ActOnUsingDeclaration(clang::Scope*, clang::AccessSpecifier, bool,
clang::SourceLocation, clang::CXXScopeSpec&, clang::UnqualifiedId&,
clang::AttributeList*, bool, clang::SourceLocation) + 541
12 clang-3.5 0x000000000167a2c1
clang::Parser::ParseUsingDeclaration(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation,
clang::SourceLocation&, clang::AccessSpecifier, clang::Decl**) + 3169
13 clang-3.5 0x000000000167aa5c
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 1500
14 clang-3.5 0x000000000167c8cc
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 2188
15 clang-3.5 0x000000000167e48a
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 4138
16 clang-3.5 0x0000000001664563
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 2867
17 clang-3.5 0x0000000001652f00
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 96
18 clang-3.5 0x0000000001653242
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 130
19 clang-3.5 0x000000000165610d
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 125
20 clang-3.5 0x0000000001656726
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 198
21 clang-3.5 0x000000000164f6f7 clang::ParseAST(clang::Sema&, bool, bool)
+ 263
22 clang-3.5 0x00000000011a8451 clang::CodeGenAction::ExecuteAction() +
97
23 clang-3.5 0x0000000000d293f9 clang::FrontendAction::Execute() + 265
24 clang-3.5 0x0000000000d086cd
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 349
25 clang-3.5 0x0000000000db50f6
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1222
26 clang-3.5 0x0000000000661ff8 cc1_main(char const**, char const**, char
const*, void*) + 920
27 clang-3.5 0x0000000000651208 main + 712
28 libc.so.6 0x00007f946a2c1ea5 __libc_start_main + 245
29 clang-3.5 0x000000000065ea05
Stack dump:
0. Program arguments:
/home/dinesh/MyWS/llvm/git/build/llvm/rel/bin/clang-3.5 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
using3.C -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-coverage-file /home/dinesh/MyWS/llvm/git/issues/using3.o -resource-dir
/home/dinesh/MyWS/llvm/git/build/llvm/rel/bin/../lib/clang/3.5.0
-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/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/c++/4.7
-internal-isystem /usr/local/include -internal-isystem
/home/dinesh/MyWS/llvm/git/build/llvm/rel/bin/../lib/clang/3.5.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /home/dinesh/MyWS/llvm/git/issues
-ferror-limit 19 -fmessage-length 198 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-slp -o using3.o -x c++ using3.C
1. using3.C:12:1: current parser token '}'
2. using3.C:10:1: parsing struct/union/class body 'B'
clang-3.5: error: unable to execute command: Aborted (core dumped)
clang-3.5: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-3.5: 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-3.5: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.5: note: diagnostic msg: /tmp/using3-af25b0.cpp
clang-3.5: note: diagnostic msg: /tmp/using3-af25b0.sh
clang-3.5: note: diagnostic msg:
********************
--
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/20140318/75d6cab8/attachment.html>
More information about the llvm-bugs
mailing list