From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12859 invoked by alias); 14 Nov 2014 16:26:27 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12814 invoked by uid 48); 14 Nov 2014 16:26:23 -0000 From: "thakis at chromium dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/63872] New: -Wunused-local-typedefs warns incorrectly on a typedef that's referenced from a template Date: Fri, 14 Nov 2014 16:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: thakis at chromium dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg01246.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D63872 Bug ID: 63872 Summary: -Wunused-local-typedefs warns incorrectly on a typedef that's referenced from a template 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 $ cat test2.cc typedef char YesType; struct NoType { YesType dummy[2]; }; template struct ShouldAbortOnSelfReset { template static NoType Test(const typename U::AllowSelfReset*); template static YesType Test(...); static const bool value =3D sizeof(Test(0)) =3D=3D sizeof(YesType); }; template struct Foo { void reset() { ShouldAbortOnSelfReset::value; } }; void f() { struct NoOpDeleter { typedef void AllowSelfReset; inline void operator()(int*) {} }; Foo f; f.reset(); } $ ~/gcc482prefix/bin/gcc -c test2.cc -std=3Dc++11 -Wall test2.cc: In function =E2=80=98void f()=E2=80=99: test2.cc:24:18: warning: typedef =E2=80=98f()::NoOpDeleter::AllowSelfReset= =E2=80=99 locally defined but not used [-Wunused-local-typedefs] typedef void AllowSelfReset; ^ test2.cc: In instantiation of =E2=80=98void Foo::reset() [with T =3D f()::NoOpDeleter]=E2=80=99: test2.cc:29:11: required from here=EF=BB=BF Warning on this is very dangerous, since removing the typedef will change t= he meaning of the code but it's still going to compile. This is with 4.8.2, but it also happens in gcc 4.9. >>From gcc-bugs-return-466775-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Nov 14 16:39:06 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 29161 invoked by alias); 14 Nov 2014 16:39:05 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 29098 invoked by uid 48); 14 Nov 2014 16:39:00 -0000 From: "richard at netbsd dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/63779] g++ 4.9 generates invalid object provoking a GOT relative relocation must reference a local symbol linker error on SunOS Date: Fri, 14 Nov 2014 16:39:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: richard at netbsd dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg01247.txt.bz2 Content-length: 644 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63779 --- Comment #2 from Richard PALO --- Sorry. Given the size, I'll use the following directory for any information needed: http://www.netbsd.org/~richard/xulrunner31-g++-issue/ Index of /~richard/xulrunner31-g++-issue Parent Directory MediaDecoderReader.cpp MediaDecoderReader.h MediaDecoderReader.ii MediaDecoderReader.o MediaDecoderReader.o.gkd MediaDecoderReader.s ld-debug.txt.gz I included the gzip'd output of the link with: LD_OPTIONS=-Dfiles,detail,reloc,got,sections,output=ld-debug.txt Anything else useful to provide?