"expected an identifier in using directive">;
def err_unexected_colon_in_nested_name_spec : Error<
"unexpected ':' in nested name specifier">;
+def err_bool_redeclaration : Error<
+ "redeclaration of C++ built-in type 'bool'">;
/// Objective-C parser diagnostics
def err_expected_minus_or_plus : Error<
break;
case tok::kw_bool:
case tok::kw__Bool:
- isInvalid = DS.SetTypeSpecType(DeclSpec::TST_bool, Loc, PrevSpec,
- DiagID);
+ if (Tok.is(tok::kw_bool) &&
+ DS.getTypeSpecType() != DeclSpec::TST_unspecified &&
+ DS.getStorageClassSpec() == DeclSpec::SCS_typedef) {
+ PrevSpec = ""; // Not used by the diagnostic.
+ DiagID = diag::err_bool_redeclaration;
+ isInvalid = true;
+ } else {
+ isInvalid = DS.SetTypeSpecType(DeclSpec::TST_bool, Loc, PrevSpec,
+ DiagID);
+ }
break;
case tok::kw__Decimal32:
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_decimal32, Loc, PrevSpec,
int Type;
};
+// rdar://8365458
+typedef char bool; // expected-error {{redeclaration of C++ built-in type 'bool'}} \
+ // expected-warning {{declaration does not declare anything}}
// PR4451 - We should recover well from the typo of '::' as ':' in a2.
namespace y {