On Fri, Jan 10, 2014 at 11:20 AM, Alexander Kornienko <[email protected]> wrote:
> This change seems to break parsing of the guarded_by attribute using the
> C++11 syntax:
>
> $ cat test.cc
> class __attribute__((lockable)) Mutex {};
>
> struct Cxx11Style {
> Mutex cxx11_mutex;
> int i [[gnu::guarded_by(cxx11_mutex)]];
> };
>
> $ clang -fsyntax-only -std=c++11 test.cc
> test.cc:5:11: warning: unknown attribute 'guarded_by' ignored [-Wattributes]
> int i [[gnu::guarded_by(cxx11_mutex)]];
> ^
> 1 warning generated.
>
>
> Is it intentional?
There is no C++11 syntax for guarded_by attributes:
def GuardedBy : InheritableAttr {
let Spellings = [GNU<"guarded_by">];
...
So I would claim it's unintentional, but not incorrect (the fact that
it used to be allowed is kind of scary, actually). Assuming that GCC
does not support this attribute, I would not be opposed to adding a
clang:: scoped spelling if it's desirable. If GCC does support this
scoped spelling, then we should update Attr.td accordingly. Delesley,
do you have any opinions on this?
~Aaron
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits