<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 - consteval constructor causes "Assertion `cast<PointerType>(getOperand(1)->getType()) ->isOpaqueOrPointeeTypeMatches(getOperand(0)->getType()) && "Ptr must be a pointer to Val type!"' failed""
   href="https://bugs.llvm.org/show_bug.cgi?id=52422">52422</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>consteval constructor causes "Assertion `cast<PointerType>(getOperand(1)->getType()) ->isOpaqueOrPointeeTypeMatches(getOperand(0)->getType()) && "Ptr must be a pointer to Val type!"' failed"
          </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>stephan.bergmann.secondary@googlemail.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>At least with clang-13.0.0~rc1-1.fc35.x86_64 and with recent Clang 14 trunk,

<span class="quote">> $ cat test.cc
> struct S {
>     consteval S() {}
>     union {
>         int a;
>         struct { int b; } c = {0};
>     };
> };
> void f() { S(); }</span >

<span class="quote">> clang++ -std=c++20 -c test.cc
> test.cc:8:12: warning: expression result unused [-Wunused-value]
> void f() { S(); }
>            ^~~
> clang++: llvm/lib/IR/Instructions.cpp:1492: void llvm::StoreInst::AssertOK(): Assertion `cast<PointerType>(getOperand(1)->getType()) ->isOpaqueOrPointeeTypeMatches(getOperand(0)->getType()) && "Ptr must be a pointer to Val type!"' failed.</span >
[...]
<span class="quote">>  #7 0x00007fe1bbcf07d3 abort (/lib64/libc.so.6+0x2c7d3)
>  #8 0x00007fe1bbcf06fb _nl_load_domain.cold (/lib64/libc.so.6+0x2c6fb)
>  #9 0x00007fe1bbcff3a6 (/lib64/libc.so.6+0x3b3a6)
> #10 0x00000000021bf9a2 llvm::Align::Align(unsigned long) llvm/include/llvm/Support/Alignment.h:78:5
> #11 0x00000000021bf9a2 llvm::StoreInst::getAlign() const llvm/include/llvm/IR/Instructions.h:354:12
> #12 0x00000000021bf9a2 llvm::StoreInst::getAlignment() const llvm/include/llvm/IR/Instructions.h:351:42
> #13 0x00000000021bf9a2 llvm::StoreInst::AssertOK() llvm/lib/IR/Instructions.cpp:1493:3
> #14 0x00000000021bfb8f llvm::StoreInst::StoreInst(llvm::Value*, llvm::Value*, bool, llvm::Align, llvm::Instruction*) llvm/lib/IR/Instructions.cpp:1517:7
> #15 0x0000000000a28250 llvm::Twine::Twine(char const*) llvm/include/llvm/ADT/Twine.h:170:14
> #16 0x0000000000a28250 llvm::IRBuilderBase::CreateAlignedStore(llvm::Value*, llvm::Value*, llvm::MaybeAlign, bool) llvm/include/llvm/IR/IRBuilder.h:1757:12
> #17 0x0000000002e7fd93 clang::CodeGen::CodeGenFunction::EmitAggregateStore(llvm::Value*, clang::CodeGen::Address, bool) clang/lib/CodeGen/CGCall.cpp:1316:61
> #18 0x0000000002ef5a44 (anonymous namespace)::AggExprEmitter::VisitConstantExpr(clang::ConstantExpr*) clang/lib/CodeGen/CGExprAgg.cpp:0:11
> #19 0x0000000002efac8c (anonymous namespace)::AggExprEmitter::VisitCastExpr(clang::CastExpr*) clang/lib/CodeGen/CGExprAgg.cpp:0:0
> #20 0x0000000002ef0737 (anonymous namespace)::AggExprEmitter::Visit(clang::Expr*) clang/lib/CodeGen/CGExprAgg.cpp:108:3
> #21 0x0000000002ef0737 clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) clang/lib/CodeGen/CGExprAgg.cpp:2000:49
> #22 0x0000000002ed0e80 clang::CodeGen::AggValueSlot::isIgnored() const clang/lib/CodeGen/CGValue.h:620:17
> #23 0x0000000002ed0e80 clang::CodeGen::AggValueSlot::asRValue() const clang/lib/CodeGen/CGValue.h:640:9
> #24 0x0000000002ed0e80 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) clang/lib/CodeGen/CGExpr.cpp:214:20
> #25 0x0000000002ed0d49 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) clang/lib/CodeGen/CGExpr.cpp:196:1
> #26 0x0000000002c593a5 llvm::IRBuilderBase::GetInsertBlock() const llvm/include/llvm/IR/IRBuilder.h:178:47
> #27 0x0000000002c593a5 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) clang/lib/CodeGen/CGStmt.cpp:123:42
> #28 0x0000000002c6511c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) clang/lib/CodeGen/CGStmt.cpp:468:22
> #29 0x0000000002cbebae clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) clang/lib/CodeGen/CodeGenFunction.cpp:0:5</span >
[...]</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>