<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Parser assertion: `SS.isEmpty() && "undeclared non-type annotation should be unqualified"'"
   href="https://bugs.llvm.org/show_bug.cgi?id=44159">44159</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Parser assertion: `SS.isEmpty() && "undeclared non-type annotation should be unqualified"'
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>arichardson.kde@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following reduced test case results in a crash:
```
// RUN: %clang_cc1 -fsyntax-only %s
class a
  template b< a :c(
```


```
/local/scratch/alr48/cheri/upstream-llvm-project/clang/test/Parser/new-test.cpp:3:8:
error: expected ';' after class
class a
       ^
       ;
/local/scratch/alr48/cheri/upstream-llvm-project/clang/test/Parser/new-test.cpp:4:17:
error: unexpected ':' in nested name specifier; did you mean '::'?
  template b< a :c(
                ^
                ::
/local/scratch/alr48/cheri/upstream-llvm-project/clang/test/Parser/new-test.cpp:4:15:
error: incomplete type 'a' named in nested name specifier
  template b< a :c(
              ^~~
/local/scratch/alr48/cheri/upstream-llvm-project/clang/test/Parser/new-test.cpp:3:7:
note: forward declaration of 'a'
class a
      ^
/local/scratch/alr48/cheri/upstream-llvm-project/clang/test/Parser/new-test.cpp:4:12:
error: no template named 'b'
  template b< a :c(
           ^
clang:
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseExprCXX.cpp:585:
clang::ExprResult clang::Parser::tryParseCXXIdExpression(clang::CXXScopeSpec &,
bool, clang::Token &): Assertion `SS.isEmpty() && "undeclared non-type
annotation should be unqualified"' failed.
Stack dump:
0.      Program arguments:
/local/scratch/alr48/cheri/build/upstream-llvm-project-build/bin/clang -cc1
-internal-isystem
/local/scratch/alr48/cheri/build/upstream-llvm-project-build/lib/clang/10.0.0/include
-nostdsysteminc -fsyntax-only
/local/scratch/alr48/cheri/upstream-llvm-project/clang/test/Parser/new-test.cpp
1.     
/local/scratch/alr48/cheri/upstream-llvm-project/clang/test/Parser/new-test.cpp:4:18:
at annotation token
 #0 0x0000000004655b34 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/local/scratch/alr48/cheri/upstream-llvm-project/llvm/lib/Support/Unix/Signals.inc:548:13
 #1 0x0000000004655b34 PrintStackTraceSignalHandler(void*)
/local/scratch/alr48/cheri/upstream-llvm-project/llvm/lib/Support/Unix/Signals.inc:608:0
 #2 0x00000000046537ee llvm::sys::RunSignalHandlers()
/local/scratch/alr48/cheri/upstream-llvm-project/llvm/lib/Support/Signals.cpp:69:18
 #3 0x0000000004655f56 SignalHandler(int)
/local/scratch/alr48/cheri/upstream-llvm-project/llvm/lib/Support/Unix/Signals.inc:390:1
 #4 0x00007ff63a420890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x00007ff638ec9e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007ff638ecb801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #7 0x00007ff638ebb39a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #8 0x00007ff638ebb412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #9 0x000000000582cce4
(/local/scratch/alr48/cheri/build/upstream-llvm-project-build/bin/clang+0x582cce4)
#10 0x000000000582df0e clang::Parser::ParseCXXIdExpression(bool)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseExprCXX.cpp:672:7
#11 0x000000000583be39 clang::Parser::ParseCastExpression(bool, bool, bool&,
clang::Parser::TypeCastState, bool)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseExpr.cpp:0:0
#12 0x000000000583b5dd clang::Parser::ParseCastExpression(bool, bool,
clang::Parser::TypeCastState, bool)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseExpr.cpp:533:20
#13 0x000000000583b5dd
clang::Parser::ParseConstantExpressionInExprEvalContext(clang::Parser::TypeCastState)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseExpr.cpp:205:0
#14 0x0000000005886211 clang::Parser::ParseTemplateArgument()
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseTemplate.cpp:1368:27
#15 0x00000000058858ed clang::Token::isNot(clang::tok::TokenKind) const
/local/scratch/alr48/cheri/upstream-llvm-project/clang/include/clang/Lex/Token.h:98:52
#16 0x00000000058858ed clang::Parser::TryConsumeToken(clang::tok::TokenKind)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/include/clang/Parse/Parser.h:457:0
#17 0x00000000058858ed clang::Parser::TryConsumeToken(clang::tok::TokenKind,
clang::SourceLocation&)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/include/clang/Parse/Parser.h:467:0
#18 0x00000000058858ed
clang::Parser::ParseTemplateArgumentList(llvm::SmallVector<clang::ParsedTemplateArgument,
16u>&)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseTemplate.cpp:1389:0
#19 0x00000000058857cc clang::Parser::ParseTemplateIdAfterTemplateName(bool,
clang::SourceLocation&, llvm::SmallVector<clang::ParsedTemplateArgument, 16u>&,
clang::SourceLocation&)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseTemplate.cpp:1054:9
#20 0x00000000058164a1
llvm::SmallVectorTemplateCommon<clang::ParsedTemplateArgument, void>::begin()
/local/scratch/alr48/cheri/upstream-llvm-project/llvm/include/llvm/ADT/SmallVector.h:127:45
#21 0x00000000058164a1 llvm::SmallVector<clang::ParsedTemplateArgument,
16u>::~SmallVector()
/local/scratch/alr48/cheri/upstream-llvm-project/llvm/include/llvm/ADT/SmallVector.h:843:0
#22 0x00000000058164a1 clang::Parser::ParseImplicitInt(clang::DeclSpec&,
clang::CXXScopeSpec*, clang::Parser::ParsedTemplateInfo const&,
clang::AccessSpecifier, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseDecl.cpp:2776:0
#23 0x0000000005811534
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseDecl.cpp:3379:13
#24 0x0000000005881e0f clang::Token::is(clang::tok::TokenKind) const
/local/scratch/alr48/cheri/upstream-llvm-project/clang/include/clang/Lex/Token.h:97:49
#25 0x0000000005881e0f
clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseTemplate.cpp:216:0
#26 0x0000000005880c25
clang::Parser::ParseExplicitInstantiation(clang::DeclaratorContext,
clang::SourceLocation, clang::SourceLocation, clang::SourceLocation&,
clang::ParsedAttributes&, clang::AccessSpecifier)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseTemplate.cpp:1424:10
#27 0x0000000005880ab0
clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseTemplate.cpp:0:0
#28 0x000000000580e5df
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseDecl.cpp:1787:10
#29 0x00000000057e4260
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/Parser.cpp:0:3
#30 0x00000000057e2ae6
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/Parser.cpp:682:10
#31 0x00000000057de098 clang::ParseAST(clang::Sema&, bool, bool)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Parse/ParseAST.cpp:157:5
#32 0x0000000004ec2d50 clang::FrontendAction::Execute()
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Frontend/FrontendAction.cpp:940:10
#33 0x0000000004e1e3f4 llvm::Error::getPtr() const
/local/scratch/alr48/cheri/upstream-llvm-project/llvm/include/llvm/Support/Error.h:273:42
#34 0x0000000004e1e3f4 llvm::Error::operator bool()
/local/scratch/alr48/cheri/upstream-llvm-project/llvm/include/llvm/Support/Error.h:236:0
#35 0x0000000004e1e3f4
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/Frontend/CompilerInstance.cpp:964:0
#36 0x0000000004f72ac3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:290:25
#37 0x0000000002954157 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/tools/driver/cc1_main.cpp:250:15
#38 0x0000000002951d54 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/local/scratch/alr48/cheri/upstream-llvm-project/clang/tools/driver/driver.cpp:309:12
#39 0x0000000002951d54 main
/local/scratch/alr48/cheri/upstream-llvm-project/clang/tools/driver/driver.cpp:382:0
#40 0x00007ff638eacb97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#41 0x000000000294f02a _start
(/local/scratch/alr48/cheri/build/upstream-llvm-project-build/bin/clang+0x294f02a)
```</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>