[LLVMbugs] [Bug 19242] attribute_deprecated_with_message enabled when [[deprecated]] is not available

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jan 11 08:23:34 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=19242

Stephen Kelly <steveire at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |FIXED

--- Comment #3 from Stephen Kelly <steveire at gmail.com> ---
According to the Clang 3.6 release notes:

Major New Features

* The __has_attribute built-in macro no longer queries for attributes across
multiple attribute syntaxes (GNU, C++11, __declspec, etc). Instead, it only
queries GNU-style attributes. With the addition of __has_cpp_attribute and
__has_declspec_attribute, this allows for more precise coverage of attribute
syntax querying.

That means that this code behaves as expected:

#if !defined(__clang__)
#define __has_cpp_attribute(x) 0
#define __has_attribute(x) 0
#endif

#if __has_cpp_attribute(deprecated)
#define DEPR_ATTR [[deprecated]]
#elif __has_attribute(deprecated)
#define DEPR_ATTR __attribute__ ((deprecated))
#else
#define DEPR_ATTR
#endif

DEPR_ATTR void something();

int main()
{
  something();
  return 0;
}

Changing the resolution from 'invalid' to fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150111/2b91edf0/attachment.html>


More information about the llvm-bugs mailing list