[LLVMbugs] [Bug 12562] New: Nested decltype() crashes the frontend

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 15 09:25:11 PDT 2012


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

             Bug #: 12562
           Summary: Nested decltype() crashes the frontend
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: llvm-bugs at quasiparticle.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This crashes the frontend:

int main() {
  decltype(decltype(1)()) x;
}

Invocation and errors:

% clang++ -std=c++11 -ofoo bar.cpp -Wall                           
Stack dump:
0.    Program arguments: /usr/bin/clang-3.1 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name bar.cpp -mrelocation-model static
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -momit-leaf-frame-pointer -resource-dir
/usr/bin/../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache
-internal-isystem
/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/x86_64-unknown-linux-gnu
-internal-isystem
/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.1/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Wall -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /dev/shm -ferror-limit 19 -fmessage-length 68
-mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak
-fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/bar-dhKLFf.o -x c++ bar.cpp 
1.    <eof> parser at end of file
2.    bar.cpp:2:1: parsing function body 'main'
clang-3: error: unable to execute command: Segmentation fault (core dumped)
clang-3: error: clang frontend command failed due to signal (use -v to see
invocation)
clang-3: note: diagnostic msg: Please submit a bug report to  and include
command line arguments and all diagnostic information.
clang-3: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang-3: note: diagnostic msg: /tmp/bar-OnVTVb.ii
clang-3: note: diagnostic msg: /tmp/bar-OnVTVb.sh


And once again, it's the -Wall that breaks it for me. Remove it, the code
compiles. Leave it there, the frontend dies. It's a fresh build from svn
(r154763). I can't make any sense of it, clang 3.0 runs fine with and without
-Wall, but it does not compile the code. Instead, it dies at the inner decltype
expecting an expression.
Not using -Wall, but -Weverything, doesn't trigger this. I can reproduce this
on multiple machines. Maybe someone else this time, too?

-- 
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