<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 - Clang crashed in during compilation"
   href="https://bugs.llvm.org/show_bug.cgi?id=46459">46459</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang crashed in during compilation
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>10.0
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>haoxintu@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This code, bug.cc, clang-10 crashed when compiling.

$cat bug.cc
namespace g_namespace {
template <class = typename a::template b<>

$clang++ bug.cc
bug.cc:2:28: error: use of undeclared identifier 'a'
template <class = typename a::template b<>
                           ^
Stack dump:
0.      Program arguments:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name bug.cc
-mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno
-fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining
-debugger-tuning=gdb -resource-dir
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/lib/clang/10.0.1
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward
-internal-isystem /usr/local/include -internal-isystem
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/lib/clang/10.0.1/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/home/haoxin/compilers/new-scg/new-scg-build/map_test/test-error-warning-opt/4/test_0/creduce
-ferror-limit 19 -fmessage-length 0 -fgnuc-version=4.2.1 -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-faddrsig -o /tmp/bug-864dde.o -x c++ bug.cc 
1.      <eof> parser at end of file
2.      bug.cc:1:1: parsing namespace 'g_namespace'
 #0 0x000000000200a374 PrintStackTraceSignalHandler(void*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x200a374)
 #1 0x000000000200804e llvm::sys::RunSignalHandlers()
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x200804e)
 #2 0x000000000200a76c SignalHandler(int)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x200a76c)
 #3 0x00007ffa432e7390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #4 0x0000000003a0f35a (anonymous
namespace)::UnnamedLocalNoLinkageFinder::VisitNestedNameSpecifier(clang::NestedNameSpecifier*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x3a0f35a)
 #5 0x00000000039a808a
clang::Sema::CheckTemplateArgument(clang::TemplateTypeParmDecl*,
clang::TypeSourceInfo*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x39a808a)
 #6 0x00000000039a7efa clang::Sema::ActOnTypeParameter(clang::Scope*, bool,
clang::SourceLocation, clang::SourceLocation, clang::IdentifierInfo*,
clang::SourceLocation, unsigned int, unsigned int, clang::SourceLocation,
clang::OpaquePtr<clang::QualType>, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x39a7efa)
 #7 0x000000000343d7be clang::Parser::ParseTypeParameter(unsigned int, unsigned
int)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x343d7be)
 #8 0x000000000343d032 clang::Parser::ParseTemplateParameter(unsigned int,
unsigned int)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x343d032)
 #9 0x000000000343c9b0 clang::Parser::ParseTemplateParameterList(unsigned int,
llvm::SmallVectorImpl<clang::NamedDecl*>&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x343c9b0)
#10 0x000000000343adf5 clang::Parser::ParseTemplateParameters(unsigned int,
llvm::SmallVectorImpl<clang::NamedDecl*>&, clang::SourceLocation&,
clang::SourceLocation&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x343adf5)
#11 0x000000000343a95c
clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x343a95c)
#12 0x000000000343a690
clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x343a690)
#13 0x00000000033a91ec
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x33a91ec)
#14 0x00000000033922c0
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x33922c0)
#15 0x00000000033c1aca
clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo,
4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&,
clang::BalancedDelimiterTracker&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x33c1aca)
#16 0x00000000033c1696 clang::Parser::ParseNamespace(clang::DeclaratorContext,
clang::SourceLocation&, clang::SourceLocation)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x33c1696)
#17 0x00000000033a938d
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x33a938d)
#18 0x00000000033922c0
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x33922c0)
#19 0x0000000003390e5a
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x3390e5a)
#20 0x0000000003390967
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x3390967)
#21 0x000000000338be9c clang::ParseAST(clang::Sema&, bool, bool)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x338be9c)
#22 0x00000000026b53c2 clang::FrontendAction::Execute()
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x26b53c2)
#23 0x000000000264e24f
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x264e24f)
#24 0x00000000027560fb
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x27560fb)
#25 0x00000000008c734f cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x8c734f)
#26 0x00000000008c5d9b ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x8c5d9b)
#27 0x00000000008c57ab main
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x8c57ab)
#28 0x00007ffa41e3c830 __libc_start_main
/build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:325:0
#29 0x00000000008c28d9 _start
(/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin/clang-10+0x8c28d9)
clang-10: error: unable to execute command: Segmentation fault (core dumped)
clang-10: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 10.0.1 
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/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/bug-ea6ca1.cpp
clang-10: note: diagnostic msg: /tmp/bug-ea6ca1.sh
clang-10: note: diagnostic msg: 

My clang version is
$clang++ --version
clang version 10.0.1 
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/haoxin/corpus-compilers/llvm-trunk/llvm-project-release-10.x/build/bin</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>