<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 in SubstituteExplicitTemplateArguments when missing typename"
   href="https://bugs.llvm.org/show_bug.cgi?id=48808">48808</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash in SubstituteExplicitTemplateArguments when missing typename
          </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>normal
          </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>christopher.halse.rogers@canonical.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>Created <span class=""><a href="attachment.cgi?id=24399" name="attach_24399" title="Preprocessed source">attachment 24399</a> <a href="attachment.cgi?id=24399&action=edit" title="Preprocessed source">[details]</a></span>
Preprocessed source

Possible duplicate of 44616.

clang-test.cpp:14:42: error: expected ';' after expression
    /* typename */ T::template Alias<int> foo;
                                         ^
                                         ;
clang-test.cpp:14:43: error: use of undeclared identifier 'foo'; did you mean
'for'?
    /* typename */ T::template Alias<int> foo;
                                          ^~~
                                          for
clang-test.cpp:14:46: error: expected '(' after 'for'
    /* typename */ T::template Alias<int> foo;
                                             ^
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.
Stack dump:
0.      Program arguments: /home/chris/.local/bin/clang-12 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name clang-test.cpp
-mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic
-fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir
/home/chris/.local/lib/clang/12.0.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/x86_64-linux-gnu/c++/10
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/x86_64-linux-gnu/c++/10
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/backward
-internal-isystem /usr/local/include -internal-isystem
/home/chris/.local/lib/clang/12.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++17 -fdeprecated-macro
-fdebug-compilation-dir /home/chris/Temp -ferror-limit 19 -fgnuc-version=4.2.1
-fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -o
/tmp/clang-test-d5e9dd.o -x c++ clang-test.cpp
1.      <eof> parser at end of file
2.      clang-test.cpp:13:6: instantiating function definition 'func<Derived>'
 #0 0x0000000004f5cc3c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/home/chris/.local/bin/clang-12+0x4f5cc3c)
 #1 0x0000000004f5a4ee llvm::sys::RunSignalHandlers()
(/home/chris/.local/bin/clang-12+0x4f5a4ee)
 #2 0x0000000004f5d2bf SignalHandler(int)
(/home/chris/.local/bin/clang-12+0x4f5d2bf)
 #3 0x00007ff20d830bf0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14bf0)
 #4 0x00000000074d0fb3
clang::Sema::SubstituteExplicitTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo&,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&,
llvm::SmallVectorImpl<clang::QualType>&, clang::QualType*,
clang::sema::TemplateDeductionInfo&)
(/home/chris/.local/bin/clang-12+0x74d0fb3)
 #5 0x00000000074d5dce
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, clang::QualType, clang::FunctionDecl*&,
clang::sema::TemplateDeductionInfo&, bool)
(/home/chris/.local/bin/clang-12+0x74d5dce)
 #6 0x00000000073b9b3c
clang::Sema::ResolveSingleFunctionTemplateSpecialization(clang::OverloadExpr*,
bool, clang::DeclAccessPair*) (/home/chris/.local/bin/clang-12+0x73b9b3c)
 #7 0x00000000073ba187
clang::Sema::ResolveAndFixSingleFunctionTemplateSpecialization(clang::ActionResult<clang::Expr*,
true>&, bool, bool, clang::SourceRange, clang::QualType, unsigned int)
(/home/chris/.local/bin/clang-12+0x73ba187)
 #8 0x00000000070cef19 clang::Sema::CheckPlaceholderExpr(clang::Expr*)
(/home/chris/.local/bin/clang-12+0x70cef19)
 #9 0x00000000071e60f0 clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool) (/home/chris/.local/bin/clang-12+0x71e60f0)
#10 0x000000000754e20c clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*,
clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::StmtDiscardKind)
(.llvm.12584484148662372181) (/home/chris/.local/bin/clang-12+0x754e20c)
#11 0x00000000075699c1 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*,
bool) (/home/chris/.local/bin/clang-12+0x75699c1)
#12 0x0000000007593c67
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool, bool)
(/home/chris/.local/bin/clang-12+0x7593c67)
#13 0x0000000007596d8b clang::Sema::PerformPendingInstantiations(bool)
(/home/chris/.local/bin/clang-12+0x7596d8b)
#14 0x0000000006d4cb53
clang::Sema::ActOnEndOfTranslationUnitFragment(clang::Sema::TUFragmentKind)
(/home/chris/.local/bin/clang-12+0x6d4cb53)
#15 0x0000000006d4d43d clang::Sema::ActOnEndOfTranslationUnit()
(/home/chris/.local/bin/clang-12+0x6d4d43d)
#16 0x0000000006c420aa
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/home/chris/.local/bin/clang-12+0x6c420aa)
#17 0x0000000006c3d69d clang::ParseAST(clang::Sema&, bool, bool)
(/home/chris/.local/bin/clang-12+0x6c3d69d)
#18 0x00000000059117c6 clang::FrontendAction::Execute()
(/home/chris/.local/bin/clang-12+0x59117c6)
#19 0x000000000585634d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/chris/.local/bin/clang-12+0x585634d)
#20 0x00000000059e8b21
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/chris/.local/bin/clang-12+0x59e8b21)
#21 0x0000000002ec7a35 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/chris/.local/bin/clang-12+0x2ec7a35)
#22 0x0000000002ec5999 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/home/chris/.local/bin/clang-12+0x2ec5999)
#23 0x0000000002ec5148 main (/home/chris/.local/bin/clang-12+0x2ec5148)
#24 0x00007ff20d2b0cf2 __libc_start_main ./csu/../csu/libc-start.c:314:16
#25 0x0000000002ec1d6e _start (/home/chris/.local/bin/clang-12+0x2ec1d6e)
clang-12: error: unable to execute command: Segmentation fault (core dumped)
clang-12: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 12.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
2d89ebd5d17b8d8800606880fe02cd867e4a0b90)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/chris/.local/bin
clang-12: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /tmp/clang-test-82cfc6.cpp
clang-12: note: diagnostic msg: /tmp/clang-test-82cfc6.sh
clang-12: 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>