r199053 - Clarify warn_cxx98_compat_attribute diagnostic

Richard Smith richard at metafoo.co.uk
Mon Jan 13 18:24:15 PST 2014


On Sun, Jan 12, 2014 at 11:14 AM, Aaron Ballman <aaron at aaronballman.com>wrote:

> After doing a bit more research and discussion off-list, I think
> "generalized attribute" is acceptable.  So patch LGTM as-is.
>

Really? I wouldn't expect someone seeing this diagnostic to understand that
"generalized attribute" means C++11 attributes (it's a really weird term,
since they're not a generalization of anything). This isn't an official
name for them, and doesn't distinguish them from the other attribute
syntaxes we support. Given that this is a diagnostic about compatibility
with C++98, "C++11 attributes" seems like the clearest way of expressing
this.


> Thanks!
>
> ~Aaron
>
> On Sun, Jan 12, 2014 at 11:46 AM, Alp Toker <alp at nuanti.com> wrote:
> >
> > On 12/01/2014 15:29, Aaron Ballman wrote:
> >
> > On Sun, Jan 12, 2014 at 10:18 AM, Alp Toker <alp at nuanti.com> wrote:
> >
> > Author: alp
> > Date: Sun Jan 12 09:18:06 2014
> > New Revision: 199053
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=199053&view=rev
> > Log:
> > Clarify warn_cxx98_compat_attribute diagnostic
> >
> > Various attribute flavours are supported in C++98. Make it clear that
> this
> > compatibility warning relates specifically to C++11-style generalized
> > attributes.
> >
> > Modified:
> >     cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
> >     cfe/trunk/test/SemaCXX/cxx98-compat.cpp
> >
> > Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
> > URL:
> >
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=199053&r1=199052&r2=199053&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
> > +++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Sun Jan 12
> > 09:18:06 2014
> > @@ -517,7 +517,7 @@ def warn_cxx98_compat_nullptr : Warning<
> >  def warn_cxx98_compat_alignas : Warning<"'alignas' is incompatible with
> > C++98">,
> >    InGroup<CXX98Compat>, DefaultIgnore;
> >  def warn_cxx98_compat_attribute : Warning<
> > -  "attributes are incompatible with C++98">,
> > +  "generalized attributes are incompatible with C++98">,
> >
> > What are "generalized" attributes? I think it would be better-worded
> > as "C++11 attributes are incompatible with C++98" (this is more
> > consistent with other parser diagnostics, as well).
> >
> >
> >
> > Hi Aaron,
> >
> > I'd say it's time to use the more natural name for C++11 attributes
> because
> > the syntax now appears in a published standard. That's the usual
> lifecycle
> > for clang language features moving from experimental to fully supported.
> >
> > As for the name itself, it's the terminology adopted by the C++ community
> > and also the name by which we advertise the feature on our own C++ status
> > page at http://clang.llvm.org/cxx_status.html:
> >
> >   Generalized attributes    N2761    Clang 3.3 (1)
> >
> > There's also a compelling reason _not_ to keep the old experimental
> naming
> > scheme indefinitely -- doing so will cause terminology dissonance as
> other
> > language dialects like ISO C look to adopt the new syntax, likewise if we
> > decide to introduce generalized attributes as a clang extension to C11 in
> > the meantime.
> >
> > Alp.
> >
> >
> >
> > Otherwise, LGTM!
> >
> > ~Aaron
> >
> >
> > --
> > http://www.nuanti.com
> > the browser experts
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140113/5d252f2c/attachment.html>


More information about the cfe-commits mailing list