"expected unqualified-id")
DIAG(err_no_declarators, ERROR,
"declaration does not declare anything")
+DIAG(ext_no_declarators, EXTENSION,
+ "typedef without a name is a Microsoft extension")
DIAG(err_func_def_no_params, ERROR,
"function definition does not declare parameters")
DIAG(err_expected_lparen_after_type, ERROR,
return Tag;
}
+ // Permit typedefs without declarators as a Microsoft extension.
if (!DS.isMissingDeclaratorOk()) {
+ if (getLangOptions().Microsoft &&
+ DS.getStorageClassSpec() == DeclSpec::SCS_typedef) {
+ Diag(DS.getSourceRange().getBegin(), diag::ext_no_declarators)
+ << DS.getSourceRange();
+ return Tag;
+ }
+
// FIXME: This diagnostic is emitted even when various previous
// errors occurred (see e.g. test/Sema/decl-invalid.c). However,
// DeclSpec has no means of communicating this information, and the