<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 - Crash on missing typename in trailing return type"
   href="https://bugs.llvm.org/show_bug.cgi?id=43113">43113</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash on missing typename in trailing return type
          </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>Linux
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>sammccall@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This appears to be pretty old, clang-7 crashes on it too.

$ cat test.cc
template <typename T> auto foo() -> T::template NestedTemplate<int>;

$ clang -fsyntax-only test.cc
/usr/local/google/home/sammccall/temp/test.cc:1:37: error: expected a type
template <typename T> auto foo() -> T::template NestedTemplate<int>;
                                    ^
/usr/local/google/home/sammccall/temp/test.cc:1:40: error: expected ';' at end
of declaration
template <typename T> auto foo() -> T::template NestedTemplate<int>;
                                       ^
                                       ;
/usr/local/google/home/sammccall/temp/test.cc:1:40: error: 'template' keyword
not permitted here
template <typename T> auto foo() -> T::template NestedTemplate<int>;
                                       ^~~~~~~~~
Stack dump:
0.      Program arguments:
/usr/local/google/home/sammccall/llvmbuild-mono/bin/clang-10 -cc1 -triple
x86_64-unknown-linux-gnu -fsyntax-only -disable-free -main-file-name test.cc
-mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/local/google/home/sammccall/llvmbuild-mono/lib/clang/9.0.0
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/google/home/sammccall/llvmbuild-mono/lib/clang/9.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/usr/local/google/home/sammccall/src/llvm-mono -ferror-limit 19
-fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -faddrsig -x c++
/usr/local/google/home/sammccall/temp/test.cc 
1.      /usr/local/google/home/sammccall/temp/test.cc:1:68: current parser
token ';'
 #0 0x0000000002457b84 PrintStackTrace
/usr/local/google/home/sammccall/src/llvm-mono/llvm/lib/Support/Unix/Signals.inc:494:13
 #1 0x0000000002457b84 PrintStackTraceSignalHandler(void*)
/usr/local/google/home/sammccall/src/llvm-mono/llvm/lib/Support/Unix/Signals.inc:554:0
 #2 0x000000000245579e llvm::sys::RunSignalHandlers()
/usr/local/google/home/sammccall/src/llvm-mono/llvm/lib/Support/Signals.cpp:69:18
 #3 0x0000000002457f98 SignalHandler(int)
/usr/local/google/home/sammccall/src/llvm-mono/llvm/lib/Support/Unix/Signals.inc:357:1
 #4 0x00007f297ed2e3a0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x123a0)
 #5 0x00000000045ae292 getTemplateDecl
/usr/local/google/home/sammccall/src/llvm-mono/clang/include/clang/AST/TemplateName.h:420:50
 #6 0x00000000045ae292 clang::TemplateName::getAsTemplateDecl() const
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/AST/TemplateName.cpp:104:0
 #7 0x00000000042d3845
clang::ASTContext::getNameForTemplate(clang::TemplateName,
clang::SourceLocation) const
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/AST/ASTContext.cpp:5247:37
 #8 0x0000000003bd8653
clang::Sema::GetNameFromUnqualifiedId(clang::UnqualifiedId const&)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Sema/SemaDecl.cpp:5104:20
 #9 0x0000000003bd8af4 isValid
/usr/local/google/home/sammccall/src/llvm-mono/clang/include/clang/Basic/SourceLocation.h:106:36
#10 0x0000000003bd8af4 isSet
/usr/local/google/home/sammccall/src/llvm-mono/clang/include/clang/Sema/DeclSpec.h:1715:0
#11 0x0000000003bd8af4 isDecompositionDeclarator
/usr/local/google/home/sammccall/src/llvm-mono/clang/include/clang/Sema/DeclSpec.h:2134:0
#12 0x0000000003bd8af4 clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Sema/SemaDecl.cpp:5377:0
#13 0x0000000003bd8a48 clang::Sema::ActOnDeclarator(clang::Scope*,
clang::Declarator&)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Sema/SemaDecl.cpp:5236:15
#14 0x00000000039d3ff0 getCurScope
/usr/local/google/home/sammccall/src/llvm-mono/clang/include/clang/Sema/Sema.h:11083:39
#15 0x00000000039d3ff0 getCurScope
/usr/local/google/home/sammccall/src/llvm-mono/clang/include/clang/Parse/Parser.h:410:0
#16 0x00000000039d3ff0
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Parse/ParseDecl.cpp:2254:0
#17 0x00000000039d2e4c clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Parse/ParseDecl.cpp:2098:21
#18 0x00000000039b91b5
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Parse/Parser.cpp:1095:10
#19 0x00000000039b8bd5
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Parse/Parser.cpp:1111:12
#20 0x00000000039b7cca
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Parse/Parser.cpp:931:12
#21 0x00000000039b5cd3
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Parse/Parser.cpp:682:10
#22 0x00000000039b1448 clang::ParseAST(clang::Sema&, bool, bool)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Parse/ParseAST.cpp:157:5
#23 0x0000000002b4819d clang::FrontendAction::Execute()
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Frontend/FrontendAction.cpp:938:10
#24 0x0000000002aea3a8 getPtr
/usr/local/google/home/sammccall/src/llvm-mono/llvm/include/llvm/Support/Error.h:273:42
#25 0x0000000002aea3a8 operator bool
/usr/local/google/home/sammccall/src/llvm-mono/llvm/include/llvm/Support/Error.h:236:0
#26 0x0000000002aea3a8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/Frontend/CompilerInstance.cpp:944:0
#27 0x0000000002be95ac
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/usr/local/google/home/sammccall/src/llvm-mono/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:291:25
#28 0x00000000009e38bf cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/usr/local/google/home/sammccall/src/llvm-mono/clang/tools/driver/cc1_main.cpp:249:15
#29 0x00000000009e149c ExecuteCC1Tool
/usr/local/google/home/sammccall/src/llvm-mono/clang/tools/driver/driver.cpp:309:12
#30 0x00000000009e149c main
/usr/local/google/home/sammccall/src/llvm-mono/clang/tools/driver/driver.cpp:381:0
#31 0x00007f297dda952b __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2352b)
#32 0x00000000009de66a _start
(/usr/local/google/home/sammccall/llvmbuild-mono/bin/clang-10+0x9de66a)
clang-10: error: unable to execute command: Segmentation fault
clang-10: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 9.0.0 (<a href="https://github.com/llvm/llvm-project">https://github.com/llvm/llvm-project</a>
fa9d232e4389bbd9ca82f8b6b34a1784107835fc)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/google/home/sammccall/llvmbuild-mono/bin
clang-10: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang-10: note: diagnostic msg: 
********************

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

********************</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>