[LLVMbugs] [Bug 21310] New: Clang 3.6 crash on invalid template specialization code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Oct 19 20:51:41 PDT 2014


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

            Bug ID: 21310
           Summary: Clang 3.6 crash on invalid template specialization
                    code
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Keywords: crash-on-invalid
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sanders_roger at hotmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13216
  --> http://llvm.org/bugs/attachment.cgi?id=13216&action=edit
Preprocessed source and run script

The following invalid template code crashed the clang compiler:

template <class T1>
class SomeClass
{
public:
    template <class T2>
    void SomeFunc(T2 someArg)
    {}
};

template <class T1>
void SomeClass<T1>::SomeFunc<int>(int someArg)
{}


The development environment is Windows 8.1 with Visual Studio 2013 Update 3,
using the following distribution of Clang for Windows:
http://llvm.org/builds/downloads/LLVM-3.6.0-r219740-win32.exe

The output log from the compilation process is as follows:
1>crash.cpp(11,21): error : cannot specialize a member of an unspecialized
template
1>  void SomeClass<T1>::SomeFunc<int>(int someArg)
1>                      ^       ~~~~~
1>  Assertion failed: TemplateTypeParm->getDepth() == 0 && "Can't deduce with
depth > 0", file ..\tools\clang\lib\Sema\SemaTemplateDeduction.cpp, line 1129
1>clang-cl.exe : error : clang frontend command failed due to signal (use -v to
see invocation)
1>  clang version 3.6.0 (219740)
1>  Target: i686-pc-windows-msvc
1>  Thread model: posix
1>  clang-cl.exe: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
1>  clang-cl.exe: note: diagnostic msg: 
1>  ********************
1>  
1>  PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
1>  Preprocessed source(s) and associated run script(s) are located at:
1>  clang-cl.exe: note: diagnostic msg: C:\TEMP\crash-68eb19.cpp
1>  clang-cl.exe: note: diagnostic msg: C:\TEMP\crash-68eb19.sh
1>  clang-cl.exe: note: diagnostic msg: 


The preprocessed source file and run script referenced in this build log are
attached to this report.

-- 
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/20141020/7caa697f/attachment.html>


More information about the llvm-bugs mailing list