This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61596] New: -Wunused-local-typedefs warns incorrectly on a typedef that's referenced indirectly
- From: "thakis at chromium dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Jun 2014 16:49:13 +0000
- Subject: [Bug c++/61596] New: -Wunused-local-typedefs warns incorrectly on a typedef that's referenced indirectly
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61596
Bug ID: 61596
Summary: -Wunused-local-typedefs warns incorrectly on a typedef
that's referenced indirectly
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: thakis at chromium dot org
-Wunused-local-typedefs warns that the typedef in line "XXX" is unused, but
it's used in line "YYY":
auto f() {
struct S {
typedef int t; // XXX
};
return S();
}
void g() {
auto x = f();
decltype(x)::t y; // YYY
}
/example.cpp: In function âauto f()â:
2 : warning: typedef âf()::S::tâ locally defined but not used
[-Wunused-local-typedefs]
struct S { typedef int t; };
^
(This is with 4.9.0. Testcase from Richard Smith.)