ExprObjectKind &OK,
SourceLocation QuestionLoc) {
- if (!getLangOpts().CPlusPlus) {
- // C cannot handle TypoExpr nodes on either side of a binop because it
- // doesn't handle dependent types properly, so make sure any TypoExprs have
- // been dealt with before checking the operands.
- ExprResult CondResult = CorrectDelayedTyposInExpr(Cond);
- if (!CondResult.isUsable()) return QualType();
- Cond = CondResult;
- }
-
ExprResult LHSResult = CheckPlaceholderExpr(LHS.get());
if (!LHSResult.isUsable()) return QualType();
LHS = LHSResult;
SourceLocation ColonLoc,
Expr *CondExpr, Expr *LHSExpr,
Expr *RHSExpr) {
+ if (!getLangOpts().CPlusPlus) {
+ // C cannot handle TypoExpr nodes in the condition because it
+ // doesn't handle dependent types properly, so make sure any TypoExprs have
+ // been dealt with before checking the operands.
+ ExprResult CondResult = CorrectDelayedTyposInExpr(CondExpr);
+ if (!CondResult.isUsable()) return ExprError();
+ CondExpr = CondResult.get();
+ }
+
// If this is the gnu "x ?: y" extension, analyze the types as though the LHS
// was the condition.
OpaqueValueExpr *opaqueValue = nullptr;
ExprResult TransformLambdaExpr(LambdaExpr *E) { return Owned(E); }
- ExprResult TransformOpaqueValueExpr(OpaqueValueExpr *E) {
- if (Expr *SE = E->getSourceExpr())
- return TransformExpr(SE);
- return BaseTransform::TransformOpaqueValueExpr(E);
- }
-
ExprResult Transform(Expr *E) {
ExprResult Res;
while (true) {
a = b ? : 0; // expected-warning {{type specifier missing, defaults to 'int'}} \
// expected-error {{use of undeclared identifier 'b'}}
+int foobar; // expected-note {{'foobar' declared here}}
+a = goobar ?: 4; // expected-warning {{type specifier missing, defaults to 'int'}} \
+ // expected-error {{use of undeclared identifier 'goobar'; did you mean 'foobar'?}} \
+ // expected-error {{initializer element is not a compile-time constant}}
+
struct ContainerStuct {
enum { SOME_ENUM }; // expected-note {{'SOME_ENUM' declared here}}
};