An invalid decltype expression like 'decltype int' gives:
error: expected '(' after 'decltype'
This makes it so 'sizeof int' gives a similar one:
error: expected parentheses around type name in sizeof expression
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192258
91177308-0d34-0410-b5e6-
96231b3b80d8
def warn_deprecated_register : Warning<
"'register' storage class specifier is deprecated">,
InGroup<DeprecatedRegister>;
-def err_missed_parentheses_around_typename : Error<
- "missed parentheses around type name in %0">;
+def err_expected_parentheses_around_typename : Error<
+ "expected parentheses around type name in %0 expression">;
def err_expected_case_before_expression: Error<
"expected 'case' keyword before expression">;
SourceLocation LParenLoc = PP.getLocForEndOfToken(OpTok.getLocation());
SourceLocation RParenLoc = PP.getLocForEndOfToken(PrevTokLocation);
- Diag(LParenLoc, diag::err_missed_parentheses_around_typename)
+ Diag(LParenLoc, diag::err_expected_parentheses_around_typename)
<< OpTok.getName()
<< FixItHint::CreateInsertion(LParenLoc, "(")
<< FixItHint::CreateInsertion(RParenLoc, ")");
static_assert(alignof(Y<int, char, 1>) == alignof(int), ""); // expected-note {{in instantiation of}}
void pr16992 () {
- int x = alignof int; // expected-error{{missed parentheses around type name in alignof}}
+ int x = alignof int; // expected-error {{expected parentheses around type name in alignof expression}}
}
template<typename T> struct ABC {
int func () {
- return sizeof T; //expected-error{{missed parentheses around type name in sizeof}}
+ return sizeof T; // expected-error {{expected parentheses around type name in sizeof expression}}
}
};
struct pr16992 { int x; };
void func_16992 () {
- int x1 = sizeof int; // expected-error{{missed parentheses around type name in sizeof}}
- int x2 = sizeof struct pr16992; // expected-error{{missed parentheses around type name in sizeof}}
- int x3 = __alignof int; // expected-error{{missed parentheses around type name in __alignof}}
- int x4 = _Alignof int; // expected-error{{missed parentheses around type name in _Alignof}}
+ int x1 = sizeof int; // expected-error {{expected parentheses around type name in sizeof expression}}
+ int x2 = sizeof struct pr16992; // expected-error {{expected parentheses around type name in sizeof expression}}
+ int x3 = __alignof int; // expected-error {{expected parentheses around type name in __alignof expression}}
+ int x4 = _Alignof int; // expected-error {{expected parentheses around type name in _Alignof expression}}
}