[clang] [C2y] Correctly handle incomplete types in generic selections (PR #141596)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue May 27 06:57:50 PDT 2025
================
@@ -1874,9 +1874,11 @@ ExprResult Sema::CreateGenericSelectionExpr(
if (D != 0) {
Diag(Types[i]->getTypeLoc().getBeginLoc(), D)
- << Types[i]->getTypeLoc().getSourceRange()
- << Types[i]->getType();
- TypeErrorFound = true;
+ << Types[i]->getTypeLoc().getSourceRange() << Types[i]->getType();
+ if (getDiagnostics().getDiagnosticLevel(
----------------
erichkeane wrote:
As a nit... this sort feels like the thing we should be asking the diagnostic builder, or at least the Diagnostics Engine.
Also, kinda showing the 'downside' to the `save the diagnostic id, then print it later` thing here.
https://github.com/llvm/llvm-project/pull/141596
More information about the cfe-commits
mailing list