clang: C++1y deprecated attribute message

Joseph Mansfield sftrabbit at
Tue Jan 28 16:58:43 PST 2014

The attached patch adds support for deprecation messages in C++1y. This is
my first time hacking with clang so a code review would definitely be

As an example of what is now supported:

[[deprecated("use bar instead")]] void foo();

When this function is used, the following warning is emitted:

warning: 'foo' is deprecated: use bar instead [-Wdeprecated-declarations]

Some tests included.

Known potential issues:
- Attribute parsing currently doesn't seem to distinguish between C++11 and
C++1y attributes.
- Maybe errors like [[deprecated("foo", "bar")]] would better report "too
many arguments" than "expected ')'". Not sure about the best way to go
about this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: deprecatedmessage.patch
Type: text/x-patch
Size: 7334 bytes
Desc: not available
URL: <>

More information about the cfe-commits mailing list