<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 - ICE on CRTP to specialization in C++20"
   href="https://bugs.llvm.org/show_bug.cgi?id=46592">46592</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ICE on CRTP to specialization in C++20
          </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>C++2a
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>llvmbugbjorn@fahller.se
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23681" name="attach_23681" title="Example code causing ICE">attachment 23681</a> <a href="attachment.cgi?id=23681&action=edit" title="Example code causing ICE">[details]</a></span>
Example code causing ICE

The attached program crashes clang++-10 if compiled with -std=c++20. When
compiled as C++11/14/17 it works. Changing the '#if 0' to '#if 1' makes it
compile as C++20.

bf :-) confuciusornis ~/d/strong_type> clang++-10 --version
Ubuntu clang version
10.0.1-++20200626112928+77d76b71d7d-1~exp1~20200626213538.59 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

bf :-) confuciusornis ~/d/strong_type> time clang++-10 -std=c++20 test.cpp -c
-Wall -Wextra -pedantic
Stack dump:
0.      Program arguments: clang++-10 -std=c++20 test.cpp -c -Wall -Wextra
-pedantic 
1.      test.cpp:22:35: current parser token '{'
2.      test.cpp:22:1: parsing struct/union/class body 'S'
/lib/x86_64-linux-gnu/libLLVM-10.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1f)[0x7fcc1dd8a2cf]
/lib/x86_64-linux-gnu/libLLVM-10.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x50)[0x7fcc1dd88580]
/lib/x86_64-linux-gnu/libLLVM-10.so.1(_ZN4llvm3sys15CleanupOnSignalEm+0xdd)[0x7fcc1dd89a1d]
/lib/x86_64-linux-gnu/libLLVM-10.so.1(+0x96bbc0)[0x7fcc1dcdfbc0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7fcc244db3c0]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang4Sema20hasVisibleDefinitionEPNS_9NamedDeclEPS2_b+0xcb)[0x7fcc230adb0b]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang4Sema23RequireCompleteTypeImplENS_14SourceLocationENS_8QualTypeEPNS0_13TypeDiagnoserE+0x450)[0x7fcc230ad350]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang4Sema23RequireCompleteTypeImplENS_14SourceLocationENS_8QualTypeEPNS0_13TypeDiagnoserE+0x8f5)[0x7fcc230ad7f5]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang4Sema19RequireCompleteTypeENS_14SourceLocationENS_8QualTypeERNS0_13TypeDiagnoserE+0xf)[0x7fcc230acddf]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang4Sema18CheckBaseSpecifierEPNS_13CXXRecordDeclENS_11SourceRangeEbNS_15AccessSpecifierEPNS_14TypeSourceInfoENS_14SourceLocationE+0xa44)[0x7fcc22c7bd94]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang4Sema18ActOnBaseSpecifierEPNS_4DeclENS_11SourceRangeERNS_16ParsedAttributesEbNS_15AccessSpecifierENS_9OpaquePtrINS_8QualTypeEEENS_14SourceLocationESA_+0x2cc)[0x7fcc22c7cd6c]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6Parser18ParseBaseSpecifierEPNS_4DeclE+0x568)[0x7fcc2255dd88]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6Parser15ParseBaseClauseEPNS_4DeclE+0x5b)[0x7fcc2255d75b]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6Parser27ParseCXXMemberSpecificationENS_14SourceLocationES1_RNS0_25ParsedAttributesWithRangeEjPNS_4DeclE+0x555)[0x7fcc2255cdf5]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6Parser19ParseClassSpecifierENS_3tok9TokenKindENS_14SourceLocationERNS_8DeclSpecERKNS0_18ParsedTemplateInfoENS_15AccessSpecifierEbNS0_15DeclSpecContextERNS0_25ParsedAttributesWithRangeE+0x1772)[0x7fcc2255ac62]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6Parser26ParseDeclarationSpecifiersERNS_8DeclSpecERKNS0_18ParsedTemplateInfoENS_15AccessSpecifierENS0_15DeclSpecContextEPNS0_18LateParsedAttrListE+0x3d4)[0x7fcc2253d174]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6Parser30ParseDeclOrFunctionDefInternalERNS0_25ParsedAttributesWithRangeERNS_15ParsingDeclSpecENS_15AccessSpecifierE+0x6a)[0x7fcc225d5dba]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6Parser36ParseDeclarationOrFunctionDefinitionERNS0_25ParsedAttributesWithRangeEPNS_15ParsingDeclSpecENS_15AccessSpecifierE+0x17c)[0x7fcc225d5a9c]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6Parser24ParseExternalDeclarationERNS0_25ParsedAttributesWithRangeEPNS_15ParsingDeclSpecE+0xaa9)[0x7fcc225d4c19]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6Parser17ParseTopLevelDeclERNS_9OpaquePtrINS_12DeclGroupRefEEEb+0x389)[0x7fcc225d2f59]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang8ParseASTERNS_4SemaEbb+0x1fd)[0x7fcc2252d69d]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang14FrontendAction7ExecuteEv+0x48)[0x7fcc239a72c8]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x621)[0x7fcc2395fd11]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x66f)[0x7fcc23a0b21f]
clang++-10(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x98d)[0x41229d]
clang++-10[0x4105b1]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(+0x194ec52)[0x7fcc236adc52]
/lib/x86_64-linux-gnu/libLLVM-10.so.1(_ZN4llvm20CrashRecoveryContext9RunSafelyENS_12function_refIFvvEEE+0xd7)[0x7fcc1dcdf9c7]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZNK5clang6driver10CC1Command7ExecuteEN4llvm8ArrayRefINS2_8OptionalINS2_9StringRefEEEEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPb+0x13f)[0x7fcc236ad18f]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZNK5clang6driver11Compilation14ExecuteCommandERKNS0_7CommandERPS3_+0x2df)[0x7fcc2368583f]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZNK5clang6driver11Compilation11ExecuteJobsERKNS0_7JobListERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x7a)[0x7fcc236859ea]
/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6driver6Driver18ExecuteCompilationERNS0_11CompilationERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0xdc)[0x7fcc23698c6c]
clang++-10(main+0x259f)[0x41002f]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fcc1ce5c0b3]
clang++-10(_start+0x2e)[0x40d7ce]
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Ubuntu clang version
10.0.1-++20200626112928+77d76b71d7d-1~exp1~20200626213538.59 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: 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: note: diagnostic msg: 
********************

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