forked from OSchip/llvm-project
Correct typos in C11 generic-selection expressions.
llvm-svn: 232760
This commit is contained in:
parent
b4db1420c2
commit
b939fb3478
|
@ -2368,7 +2368,8 @@ ExprResult Parser::ParseGenericSelectionExpression() {
|
|||
// C11 6.5.1.1p3 "The controlling expression of a generic selection is
|
||||
// not evaluated."
|
||||
EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated);
|
||||
ControllingExpr = ParseAssignmentExpression();
|
||||
ControllingExpr =
|
||||
Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression());
|
||||
if (ControllingExpr.isInvalid()) {
|
||||
SkipUntil(tok::r_paren, StopAtSemi);
|
||||
return ExprError();
|
||||
|
@ -2414,7 +2415,8 @@ ExprResult Parser::ParseGenericSelectionExpression() {
|
|||
|
||||
// FIXME: These expressions should be parsed in a potentially potentially
|
||||
// evaluated context.
|
||||
ExprResult ER(ParseAssignmentExpression());
|
||||
ExprResult ER(
|
||||
Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression()));
|
||||
if (ER.isInvalid()) {
|
||||
SkipUntil(tok::r_paren, StopAtSemi);
|
||||
return ExprError();
|
||||
|
|
|
@ -28,3 +28,9 @@ void func(int arg) {
|
|||
;
|
||||
}
|
||||
}
|
||||
|
||||
void banana(void); // expected-note {{'banana' declared here}}
|
||||
int c11Generic(int arg) {
|
||||
_Generic(hello, int : banana)(); // expected-error-re {{use of undeclared identifier 'hello'{{$}}}}
|
||||
_Generic(arg, int : bandana)(); // expected-error {{use of undeclared identifier 'bandana'; did you mean 'banana'?}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue