[clang][bytecode] Handle invalid function in CXXInheritedCtorInitExpr (#209138)

This commit is contained in:
Timm Baeder authored and GitHub committed 2026-07-13 14:04:08 +02:00
1 parent a5fc1d68f9
commit a4364df185
2 files changed
+16 -1

No files matched your search

+2 -1
View File
@@ -4140,7 +4140,8 @@ bool Compiler<Emitter>::VisitCXXInheritedCtorInitExpr(
assert(!Ctor->isTrivial() &&
"Trivial CXXInheritedCtorInitExpr, implement. (possible?)");
const Function *F = this->getFunction(Ctor);
assert(F);
if (!F)
return false;
assert(!F->hasRVO());
assert(F->hasThisPointer());
+14
View File
@@ -227,3 +227,17 @@ namespace DefinitionInBody {
return 5;
}
}
namespace InheritedCtor {
struct S {
constexpr S(int = ; // both-note {{to match this}} \
// both-error {{expected ';' at end of declaration list}} \
// both-error {{expected expression}}
}; // both-error {{expected ')'}}
struct SS : S {
using S::S;
};
SS ss{42};
}