[llvm-bugs] [Bug 49834] New: n CodeGen::CodeGenFunction::EmitCallArgs: Assertion `[...] && "type mismatch in call argument!"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Apr 4 09:03:45 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=49834

            Bug ID: 49834
           Summary: n CodeGen::CodeGenFunction::EmitCallArgs: Assertion
                    `[...] && "type mismatch in call argument!"' failed
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zahira.ammarguellat at intel.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

This test case:

template<typename = int>
void f (const char* a =
        ([](int = [] {
                    static int i; return 42;
                  }()) {
           static int i; return "";
         }()));

void g() {
  f();
}

compiles with clang 10.0. See https://godbolt.org/z/eEbW6Gnjf 
and fails with an assertion. See https://godbolt.org/z/41GbzPa4Y 

Assertion failed: (isGenericMethod || Ty->isVariablyModifiedType() ||
Ty.getNonReferenceType()->isObjCRetainableType() || getContext()
.getCanonicalType(Ty.getNonReferenceType()) .getTypePtr() ==
getContext().getCanonicalType((*Arg)->getType()).getTypePtr()) && "type
mismatch in call argument!", file CGCall.cpp, line 4072

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210404/6b2b3f71/attachment.html>


More information about the llvm-bugs mailing list