[LLVMbugs] [Bug 23943] New: clang crashes due to infinite template recursion

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 25 05:15:08 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23943

            Bug ID: 23943
           Summary: clang crashes due to infinite template recursion
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: wojas1222 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14517
  --> https://llvm.org/bugs/attachment.cgi?id=14517&action=edit
the crash backtrace

Clang crashes when given a type dependent on infinite-recursive template as a
template parameter.

The code is not valid as it is, but the clang crashing was not the expected
reaction.

You can reproduce the issue by compiling the following code with Clang 3.6.1
(I'm using the build from MSYS2)

template<typename T>
struct Concat
{
    typedef int type;
};

template<typename T, T Count>
struct Iota
{
    typedef typename Concat<
        typename Iota<T, Count-1>::type
    >::type type;
};

Iota<int, 4>::type err;

int main() {}


The run script is as follows:

 "C:\\__MOJE\\prog\\MSYS2_Toolset64\\mingw64\\bin\\clang++.exe" "-cc1"
"-triple" "x86_64-w64-windows-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-disable-llvm-verifier" "-main-file-name" "ice.cpp" "-mrelocation-model" "pic"
"-pic-level" "2" "-mthread-model" "posix" "-mdisable-fp-elim" "-fmath-errno"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-target-linker-version" "2.25" "-dwarf-column-info" "-std=c++11"
"-fdeprecated-macro" "-ferror-limit" "19" "-fmessage-length" "0"
"-mstackrealign" "-fno-use-cxa-atexit" "-fobjc-runtime=gcc" "-fcxx-exceptions"
"-fexceptions" "-fdiagnostics-show-option" "-x" "c++" "ice-143b03.cpp"

The trace is in the attachment.

The clang++ -v output is:

clang version 3.6.1 (tags/RELEASE_361/final)
Target: x86_64-w64-windows-gnu
Thread model: posix

-- 
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/20150625/7fb6d4f3/attachment.html>


More information about the llvm-bugs mailing list