r302255 - Warn that the [] spelling of uuid(...) is deprecated.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Fri May 5 10:28:34 PDT 2017


On Fri, May 5, 2017 at 1:21 PM, Aaron Ballman via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> On Fri, May 5, 2017 at 1:05 PM, Nico Weber via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
> > Author: nico
> > Date: Fri May  5 12:05:56 2017
> > New Revision: 302255
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=302255&view=rev
> > Log:
> > Warn that the [] spelling of uuid(...) is deprecated.
> >
> > https://reviews.llvm.org/D32879
> >
> > Modified:
> >     cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> >     cfe/trunk/lib/Parse/ParseDeclCXX.cpp
> >     cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> >     cfe/trunk/test/Parser/MicrosoftExtensions.cpp
> >     cfe/trunk/test/Parser/ms-square-bracket-attributes.mm
> >     cfe/trunk/test/SemaCXX/ms-uuid.cpp
> >
> > Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/
> DiagnosticSemaKinds.td?rev=302255&r1=302254&r2=302255&view=diff
> > ============================================================
> ==================
> > --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
> > +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri May  5
> 12:05:56 2017
> > @@ -730,6 +730,9 @@ def err_super_in_lambda_unsupported : Er
> >  def warn_pragma_unused_undeclared_var : Warning<
> >    "undeclared variable %0 used as an argument for '#pragma unused'">,
> >    InGroup<IgnoredPragmas>;
> > +def warn_atl_uuid_deprecated : Warning<
> > +  "specifying 'uuid' as an ATL attribute is deprecated; use __declspec
> instead">,
> > +  InGroup<DeprecatedDeclarations>;
> >  def warn_pragma_unused_expected_var_arg : Warning<
> >    "only variables can be arguments to '#pragma unused'">,
> >    InGroup<IgnoredPragmas>;
> >
> > Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
> > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/
> ParseDeclCXX.cpp?rev=302255&r1=302254&r2=302255&view=diff
> > ============================================================
> ==================
> > --- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
> > +++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Fri May  5 12:05:56 2017
> > @@ -4151,8 +4151,6 @@ void Parser::ParseMicrosoftUuidAttribute
> >    }
> >
> >    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);
> >
> > Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/
> SemaDeclAttr.cpp?rev=302255&r1=302254&r2=302255&view=diff
> > ============================================================
> ==================
> > --- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
> > +++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Fri May  5 12:05:56 2017
> > @@ -5079,6 +5079,15 @@ static void handleUuidAttr(Sema &S, Decl
> >      }
> >    }
> >
> > +  // 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"
>
> You introduced some non-ASCII characters in this comment. Can you fix that
> up?
>

Sure, 302258. Thanks for catching.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170505/8ccca636/attachment.html>


More information about the cfe-commits mailing list