[LLVMbugs] [Bug 19623] New: Assertion with template alias and gdwarf-2

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 1 08:22:57 PDT 2014


            Bug ID: 19623
           Summary: Assertion with template alias and gdwarf-2
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jonathan.sauer at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12463
  --> http://llvm.org/bugs/attachment.cgi?id=12463&action=edit
Log of clang run

The following program crashes clang r207398 when compiling with -gdwarf-2:

template <bool>
struct enable_if { };

template <>
struct enable_if<true> { using type = void; };

template <bool C>
using enable_if_t = typename enable_if<C>::type;

template <unsigned int M, enable_if_t<M == 1>* = nullptr>              // A
//template <unsigned int M, typename enable_if<M == 1>::type* = nullptr> // B
static void foo() {}

int main()

This results in (full log attached):

% ~/LLVM/build/Release+Asserts/bin/clang++ -std=c++11 -gdwarf-2 clang.cpp
Assertion failed: (Src), function CreateType, file
/Users/rynnsauer/LLVM/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp, line 725.
0  clang                    0x00000001066b7388
llvm::sys::PrintStackTrace(__sFILE*) + 40
1  clang                    0x00000001066b7884 SignalHandler(int) + 548
2  libsystem_platform.dylib 0x00007fff96f565aa _sigtramp + 26
3  libsystem_platform.dylib 000000000000000000 _sigtramp + 1762302576
4  clang                    0x00000001066b7646 abort + 22
5  clang                    0x00000001066b7621 __assert_rtn + 81
6  clang                    0x00000001050c551a
const*, llvm::DIFile) + 682
7  clang 

When compiling with line B instead of line A (using enable_if directly instead
of via a template alias), the code compiles successfully.

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/20140501/2d57b360/attachment.html>

More information about the llvm-bugs mailing list