[llvm-bugs] [Bug 24547] New: Crash while parsing of invalid template specialization

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Aug 22 10:29:16 PDT 2015


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

            Bug ID: 24547
           Summary: Crash while parsing of invalid template specialization
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ismail.pazarbasi at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

// partialspeccrash.cpp
template<typename T>
struct X {
  template<typename U>
  T *f(U);
};

template<typename T>
template<typename U>
T *X<T>::f<u>(U) {
  return nullptr;
}


% clang++ -fsyntax-only -std=c++11 partialspeccrash.cpp
./projects/llvm-tests/partialspeccrash.cpp:11:12: error: use of undeclared
identifier 'u'
T *X<T>::f<u>(U u) {
           ^
./projects/llvm-tests/partialspeccrash.cpp:11:17: error: expected ')'
T *X<T>::f<u>(U u) {
                ^
./projects/clang-crasher.cpp:11:14: note: to match this '('
T *X<T>::f<u>(U u) {
             ^
Assertion failed: (!EnteredScope && "Already entered the scope!"), function
EnterDeclaratorScope, file
/Users/ismailp/Projects/llvm-trunk/llvm/tools/clang/include/clang/Parse/Parser.h,
line 2254.
... [backtrace]

Seems like to be similar to bugs 19340 and 21310, but backtrace is different.

-- 
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/20150822/a80054f2/attachment.html>


More information about the llvm-bugs mailing list