[llvm-bugs] [Bug 31146] New: Clang Crash on malformed input

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 23 15:03:46 PST 2016


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

            Bug ID: 31146
           Summary: Clang Crash on malformed input
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: charles_li at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17640
  --> https://llvm.org/bugs/attachment.cgi?id=17640&action=edit
run script

We came across a Clang ICE on malformed input while reducing the test-case of
a separate problem.


This ICE does not appear to be a regression.
I can reproduced this ICE since SVN revision 240000.


Here is the test
$ cat t.cpp

template<class Alpha,
class Bravo,
class Charlie
  : public Delta<Alpha, Bravo, Echo>
  : Delta<Alpha, Bravo, Echo>(Foxtrot(Golf), Hotel)
  {
explicit Charlie(const India& _Str, size_t Hotel = 0)
    {


Here are the relevant error messages from the crash dump
$ clang++ -c t.cpp

clang-4.0: /home/chli/Source/usvn/llvm/tools/clang/lib/Sema/SemaInit.cpp:6296:
clang::ExprResult clang::InitializationSequence::Perform(clang::Sema&, const
clang::InitializedEntity&, const clang::InitializationKind&,
clang::MultiExprArg, clang::QualType*): 
Assertion `Kind.getKind() == InitializationKind::IK_Copy ||
Kind.isExplicitCast() || Kind.getKind() == InitializationKind::IK_DirectList'
failed.

.....

Stack dump:
1.      t.cpp:8:5: current parser token '{'
2.      t.cpp:3:2: parsing struct/union/class body 'Charlie'
clang-4.0: error: unable to execute command: Aborted (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (trunk 284398)
Target: x86_64-unknown-linux-gnu
Thread model: posix

********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-4.0: note: diagnostic msg: /tmp/t-9920bc.cpp
clang-4.0: note: diagnostic msg: /tmp/t-9920bc.sh

-- 
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/20161123/226e36c8/attachment-0001.html>


More information about the llvm-bugs mailing list