[llvm-bugs] [Bug 40374] New: ICE/Segfault when parsing incorrect template arguments of nested classes, OS X only?

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 18 10:07:58 PST 2019


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

            Bug ID: 40374
           Summary: ICE/Segfault when parsing incorrect template arguments
                    of nested classes, OS X only?
           Product: clang
           Version: 7.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: markus at dreseler.de
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 21354
  --> https://bugs.llvm.org/attachment.cgi?id=21354&action=edit
Crash info

The following code leads to an ICE:


#include <type_traits>
class JoinHash {};
template <typename LeftType, typename = std::enable_if_t<bool>
class JoinHash::JoinHashImpl {};


Error:

1.      clangice.cpp:6:30: current parser token '{'
0  clang-7                  0x000000010a9e2356
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  clang-7                  0x000000010a9e274e SignalHandler(int) + 192
2  libsystem_platform.dylib 0x00007fff6e56ab3d _sigtramp + 29
3  libsystem_platform.dylib 0x00007ffee61e1597 _sigtramp + 2009557623
4  clang-7                  0x000000010bc0dbf6 clang::TypeLoc::getBeginLoc()
const + 118
5  clang-7                  0x000000010bbd3437
clang::NestedNameSpecifierLoc::getLocalSourceRange() const + 143
6  clang-7                  0x000000010b62698d
clang::CXXScopeSpec::getLastQualifierNameLoc() const + 37
[...]


Interestingly, this happens *after* the correct error message is printed. Also,
I am unable to reproduce it on Godbolt or my Linux machines.

clang version 7.0.0 (tags/RELEASE_700/final)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
(Installed via brew)

-- 
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/20190118/80a2941e/attachment-0001.html>


More information about the llvm-bugs mailing list