diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2017-05-05 17:05:56 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2017-05-05 17:05:56 +0000 |
| commit | 469891e7a2937dbbb0a8cb2d4972c8592a142bdb (patch) | |
| tree | ac5ee87e30bf6fa5ff9bb3732ef051b7e1422952 /clang/lib | |
| parent | 25597b2cc924a7fb94c2c15ddcafc9eee10ffda4 (diff) | |
| download | bcm5719-llvm-469891e7a2937dbbb0a8cb2d4972c8592a142bdb.tar.gz bcm5719-llvm-469891e7a2937dbbb0a8cb2d4972c8592a142bdb.zip | |
Warn that the [] spelling of uuid(...) is deprecated.
https://reviews.llvm.org/D32879
llvm-svn: 302255
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index b25152a3183..ad7b319676e 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -4151,8 +4151,6 @@ void Parser::ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs) { } if (!T.consumeClose()) { - // FIXME: Warn that this syntax is deprecated, with a Fix-It suggesting - // using __declspec(uuid()) instead. Attrs.addNew(UuidIdent, SourceRange(UuidLoc, T.getCloseLocation()), nullptr, SourceLocation(), ArgExprs.data(), ArgExprs.size(), AttributeList::AS_Microsoft); diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 9cbfcd1503a..fa831f8ddf7 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -5079,6 +5079,15 @@ static void handleUuidAttr(Sema &S, Decl *D, const AttributeList &Attr) { } } + // FIXME: It'd be nice to also emit a fixit removing uuid(...) (and, if it's + // the only thing in the [] list, the [] too), and add an insertion of + // __declspec(uuid(...)). But sadly, neither the SourceLocs of the commas + // separating attributes nor of the [ and the ] are in the AST. + // Cf "SourceLocations of attribute list delimiters – [[ ... , ... ]] etc" + // on cfe-dev. + if (Attr.isMicrosoftAttribute()) // Check for [uuid(...)] spelling. + S.Diag(Attr.getLoc(), diag::warn_atl_uuid_deprecated); + UuidAttr *UA = S.mergeUuidAttr(D, Attr.getRange(), Attr.getAttributeSpellingListIndex(), StrRef); if (UA) |

