<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 asserts with coroutines in EmitScalarExpr: E && hasScalarEvaluationKind(E->getType()) && "Invalid scalar expression to emit""
   href="https://bugs.llvm.org/show_bug.cgi?id=43923">43923</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang asserts with coroutines in EmitScalarExpr: E && hasScalarEvaluationKind(E->getType()) && "Invalid scalar expression to emit"
          </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>C++2a
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, danalbert@google.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk, srhines@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22781" name="attach_22781" title="repro input">attachment 22781</a> <a href="attachment.cgi?id=22781&action=edit" title="repro input">[details]</a></span>
repro input

This was originally reported in the Android NDK bugtracker at
<a href="https://github.com/android/ndk/issues/1119">https://github.com/android/ndk/issues/1119</a>.

Godbolt link: <a href="https://godbolt.org/z/InGxJi">https://godbolt.org/z/InGxJi</a>
Source file attached.

To repro:
clang++ -std=c++2a shop-fac221.cpp
Stack trace:
 #0 0x0000000007ff30b9 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/ssd2/pirama/llvm-monorepo/monorepo/llvm/lib/Support/Unix/Signals.inc:532:11    
 #1 0x0000000007ff3269 PrintStackTraceSignalHandler(void*)
/ssd2/pirama/llvm-monorepo/monorepo/llvm/lib/Support/Unix/Signals.inc:593:1
 #2 0x0000000007ff1b36 llvm::sys::RunSignalHandlers()
/ssd2/pirama/llvm-monorepo/monorepo/llvm/lib/Support/Signals.cpp:67:5
 #3 0x0000000007ff39cb SignalHandler(int)
/ssd2/pirama/llvm-monorepo/monorepo/llvm/lib/Support/Unix/Signals.inc:384:1
 #4 0x00007fc102e8f3a0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x123a0)
 #5 0x00007fc102130cfb raise (/lib/x86_64-linux-gnu/libc.so.6+0x36cfb)
 #6 0x00007fc10211b8ad abort (/lib/x86_64-linux-gnu/libc.so.6+0x218ad)
 #7 0x00007fc10211b77f (/lib/x86_64-linux-gnu/libc.so.6+0x2177f)
 #8 0x00007fc102129542 (/lib/x86_64-linux-gnu/libc.so.6+0x2f542)
 #9 0x000000000881afc9
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CGExprScalar.cpp:4444:
35                  
#10 0x0000000008877b03
clang::CodeGen::CodeGenFunction::EmitCoroutineBody(clang::CoroutineBodyStmt
const&) /ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CGCoroutine.
cpp:568:9
#11 0x00000000086f6f76 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGe
n/CGStmt.cpp:151:5
#12 0x00000000086bbed5
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeGenFunction.cpp:1059:1
#13 0x00000000086bc93a
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
/ssd2/pirama/llvm-monorepo/mo
norepo/clang/lib/CodeGen/CodeGenFunction.cpp:1222:3
#14 0x000000000858a1c4
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) /ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeG
en/CodeGenModule.cpp:4423:3
#15 0x00000000085812db
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) /ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeG
enModule.cpp:0:9
#16 0x0000000008577cc7 clang::CodeGen::CodeGenModule::EmitDeferred()
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeGenModule.cpp:2132:5
#17 0x000000000857632f clang::CodeGen::CodeGenModule::Release()
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeGenModule.cpp:393:3
#18 0x0000000008edd832 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/ModuleBuilde
r.cpp:0:18
#19 0x0000000008ed7797
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeGenAction.cpp:242:14
#20 0x000000000afc307c clang::ParseAST(clang::Sema&, bool, bool)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/Parse/ParseAST.cpp:178:12
#21 0x0000000008d2bc72 clang::ASTFrontendAction::ExecuteAction()
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/Frontend/FrontendAction.cpp:1044:1
#22 0x0000000008ed51cc clang::CodeGenAction::ExecuteAction()
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/CodeGen/CodeGenAction.cpp:1089:1
#23 0x0000000008d2b621 clang::FrontendAction::Execute()
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/Frontend/FrontendAction.cpp:939:7
#24 0x0000000008c59591
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/Frontend/CompilerInstance.cpp:964:23
#25 0x0000000008ebf66f
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/ssd2/pirama/llvm-monorepo/monorepo/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:29
0:8
#26 0x000000000514b78e cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/ssd2/pirama/llvm-monorepo/monorepo/clang/tools/driver/cc1_main.cpp:250:13
#27 0x000000000513f49f ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/ssd2/pirama/llvm-monorepo/monorepo/clang/tools/driver/driver.cpp:309:5
#28 0x000000000513e832 main
/ssd2/pirama/llvm-monorepo/monorepo/clang/tools/driver/driver.cpp:382:5
#29 0x00007fc10211d52b __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2352b)
#30 0x000000000513e02a _start
(/ssd2/pirama/llvm-monorepo/debug/bin/clang-10+0x513e02a)</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>