Index: clang/lib/Sema/SemaChecking.cpp =================================================================== --- clang/lib/Sema/SemaChecking.cpp +++ clang/lib/Sema/SemaChecking.cpp @@ -14369,6 +14369,10 @@ static void CheckConditionalOperand(Sema &S, Expr *E, QualType T, SourceLocation CC, bool &ICContext) { E = E->IgnoreParenImpCasts(); + if (!S.getLangOpts().CPlusPlus && E->getType()->isRecordType()) { + S.RequireCompleteType(E->getBeginLoc(), E->getType(), + diag::err_incomplete_type); + } if (auto *CO = dyn_cast(E)) return CheckConditionalOperator(S, CO, CC, T);