[LLVMbugs] [Bug 12362] New: crash when using template alias default arguments wich are themselves template types

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 26 15:17:26 PDT 2012


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

             Bug #: 12362
           Summary: crash when using template alias default arguments wich
                    are themselves template types
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: freunddeslichts at web.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Clang++ crashes on the folloging code



template <int N, typename T>
struct point {
    T data[N];
};


template <int K, typename T>
struct recursion;


template <typename T>
struct recursion<0, T> {

    template <typename T2 = T>
    using pt = point<3, T2>;


    static int test(const pt<>&)
    {
        return 0;
    }
};


int main(void)
{
    return 0;
}



output is as follows

~/Dokumente/clang/release2/Release/bin/clang++  -std=c++0x bug.cpp -Wall
0  clang 0x0977314b
Stack dump:
0.    Program arguments: /home/tobi/Dokumente/clang/release2/Release/bin/clang
-cc1 -triple i386-pc-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name bug.cpp -mrelocation-model static
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu pentium4
-momit-leaf-frame-pointer -resource-dir
/home/tobi/Dokumente/clang/release2/Release/bin/../lib/clang/3.1
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/c++/4.7 -internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/c++/4.7/i686-linux-gnu
-internal-isystem
/usr/lib/gcc/i686-linux-gnu/4.7/../../../../include/c++/4.7/backward
-internal-isystem /usr/local/include -internal-isystem
/home/tobi/Dokumente/clang/release2/Release/bin/../lib/clang/3.1/include
-internal-externc-isystem /usr/include/i386-linux-gnu -internal-externc-isystem
/include -internal-externc-isystem /usr/include -Wall -std=c++0x
-fdeprecated-macro -fdebug-compilation-dir /home/tobi/Dokumente/bug
-ferror-limit 19 -fmessage-length 178 -mstackrealign -fgnu-runtime
-fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/bug-i6NxPy.o -x c++ bug.cpp 
1.    bug.cpp:21:24: at annotation token 
2.    bug.cpp:15:1: parsing struct/union/class body 'recursion'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/bug-3L1HIS.ii
clang: note: diagnostic msg: /tmp/bug-3L1HIS.sh

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