This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53551] New: -Wunused-local-typedefs misses uses
- From: "akim.demaille at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 01 Jun 2012 12:23:13 +0000
- Subject: [Bug c++/53551] New: -Wunused-local-typedefs misses uses
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53551
Bug #: 53551
Summary: -Wunused-local-typedefs misses uses
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: akim.demaille@gmail.com
Hi!
In the following example, the "context" struct provides types to a template
class, "structure". The provided type is used to define a member variable.
Yet G++ 4.8 claims:
g++-mp-4.8 -std=c++11 -Wall bar.cc
bar.cc: In function 'int main()':
bar.cc:12:21: warning: typedef 'using type = int' locally defined but not used
[-Wunused-local-typedefs]
using type = int;
^
This is:
g++-mp-4.8 (MacPorts gcc48 4.8-20120527_1) 4.8.0 20120527 (experimental)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The program is:
template <typename C>
struct structure
{
typename C::type val;
};
int
main()
{
struct context
{
using type = int;
};
return structure<context>{42}.val;
}
Thanks!