r197654 - /branches/google/main/gcc/c-family/c-...
tejohnson@gcc.gnu.org
tejohnson@gcc.gnu.org
Tue Apr 9 23:26:00 GMT 2013
Author: tejohnson
Date: Tue Apr 9 23:26:29 2013
New Revision: 197654
URL: http://gcc.gnu.org/viewcvs?rev=197654&root=gcc&view=rev
Log:
This patch is pending on trunk, but I would like to get this into google
branches now as it is causing spurious warnings.
Google ref b/8496800.
This patch allows the unused attribute to be used without warning
on C++ class members, which are of type FIELD_DECL. This is for
compatibility with clang, which allows the attribute to be specified on
class members and struct fields. It looks like more work would need to
be done to implement the actual unused variable detection and warning
on FIELD_DECLs, but this change will at least avoid the warning on the
code that uses the unused attribute in these cases. The documentation at
http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html also doesn't
seem to preclude its use on C++ member variables.
Bootstrapped and tested on x86-64-unknown-linux-gnu. Ok for google branches?
2013-04-09 Teresa Johnson <tejohnson@google.com>
* c-family/c-common.c (handle_unused_attribute): Allow attribute
on FIELD_DECL (struct fields and C++ member variables).
Modified:
branches/google/main/gcc/c-family/c-common.c
More information about the Gcc-cvs
mailing list