This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33255] A warning for "unused" typedefs?
- From: "dodji at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 24 Jul 2011 21:58:49 +0000
- Subject: [Bug c++/33255] A warning for "unused" typedefs?
- Auto-submitted: auto-generated
- References: <bug-33255-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33255
--- Comment #15 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-07-24 21:57:47 UTC ---
Created attachment 24820
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24820
Work in progress patch
This works only on the C++ FE (not on the C FE yet) for now and has been
lightly tested so far.
I ran it on libstdc++ and so far it fell short only on the use of
PB_DS_STATIC_ASSERT (and friends) which defines a typedef. When this macro is
expanded in a function that doesn't use the typedef it defines, the patch
warns. Normally, it shouldn't warn b/c the macro is defined in a system
header. But with the current (libcpp) infrastructure, we cannot tell the
difference between a typedef defined in a system header macro that is expanded
in a local function, and a typedef that is directly defined in the function.
Normally with the work being done on PR proprocessor/7263 this patch should not
warn in those case. At least if my understanding of the issue is correct.
The warning option is -Wunused-local-typedefs and is activated by -Wall
-Wextra, or -Wunused -Wextra.
I am putting it here for now in case someone has interesting test cases to add.