[LLVMbugs] [Bug 18260] New: Attempting to call member func named 'move' crashes the compiler if using -Weverything

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 16 02:08:15 PST 2013


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

            Bug ID: 18260
           Summary: Attempting to call member func named 'move' crashes
                    the compiler if using -Weverything
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jj at medical-insight.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11737
  --> http://llvm.org/bugs/attachment.cgi?id=11737&action=edit
test case to reproduce crash

If I have a class/struct with a member named 'move()' and a function that
attempts to call it (doesn't matter if it's through a pointer or reference),
then the code will build and run fine unless I attempt to build with
"-Weverything" - then the compiler crashes.

$ clang++ --version
clang version 3.5 (trunk 197368)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ cat ./move.cc 
struct A
{
    void move() {}
};

int main()
{
    A a;
    a.move();
}
$ clang++ ./move.cc 
$ echo $?
0
$ clang++ -Weverything ./move.cc 
clang:
/home/jj/src/llvm/tools/clang/lib/Analysis/../../include/clang/AST/Expr.h:2194:
const clang::Expr *clang::CallExpr::getArg(unsigned int) const: Assertion `Arg
< NumArgs && "Arg access out of range!"' failed.
0  clang           0x00000000021fe4a5 llvm::sys::PrintStackTrace(_IO_FILE*) +
37
1  clang           0x00000000021fe8e3
2  libpthread.so.0 0x000000336520f710
3  libc.so.6       0x0000003364632925 gsignal + 53
4  libc.so.6       0x0000003364634105 abort + 373
5  libc.so.6       0x000000336462ba4e
6  libc.so.6       0x000000336462bb10 __assert_perror_fail + 0
7  clang           0x0000000001188626
8  clang           0x00000000011894eb
clang::consumed::ConsumedStmtVisitor::VisitCXXMemberCallExpr(clang::CXXMemberCallExpr
const*) + 27
9  clang           0x000000000118dc98
clang::consumed::ConsumedAnalyzer::run(clang::AnalysisDeclContext&) + 1160
10 clang           0x0000000000da60e6
clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy,
clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) +
4518
11 clang           0x0000000000a4b4c3
clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy
const*, clang::Decl const*, clang::BlockExpr const*) + 99
12 clang           0x0000000000aefcb3
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 3299
13 clang           0x0000000000a1fe4b
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 283
14 clang           0x00000000009aea65
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
2053
15 clang           0x00000000009c035d
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1357
16 clang           0x00000000009ae0d2
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 690
17 clang           0x00000000009adb13
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 403
18 clang           0x00000000009acd3d
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2493
19 clang           0x00000000009ac2a3
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 483
20 clang           0x00000000009a8686 clang::ParseAST(clang::Sema&, bool, bool)
+ 454
21 clang           0x0000000000834d82 clang::CodeGenAction::ExecuteAction() +
514
22 clang           0x00000000006aa560 clang::FrontendAction::Execute() + 112
23 clang           0x000000000068789d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 925
24 clang           0x000000000066ee40
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2880
25 clang           0x0000000000666a4f cc1_main(char const**, char const**, char
const*, void*) + 687
26 clang           0x000000000066d0a0 main + 9136
27 libc.so.6       0x000000336461ed1d __libc_start_main + 253
28 clang           0x00000000006666d9
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
move.cc -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.20.51.0.2 -resource-dir /usr/local/bin/../lib/clang/3.5 -internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/x86_64-redhat-linux/c++/4.4.7
-internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.5/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Weverything -fdeprecated-macro
-fdebug-compilation-dir /tmp/move-test -ferror-limit 19 -fmessage-length 146
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o
/tmp/move-a63530.o -x c++ ./move.cc 
1.    <eof> parser at end of file
2.    ./move.cc:7:1: parsing function body 'main'
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.5 (trunk 197368)
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/move-e3e6fe.cpp
clang: note: diagnostic msg: /tmp/move-e3e6fe.sh
clang: 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/20131216/30f00f03/attachment.html>


More information about the llvm-bugs mailing list