From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17406 invoked by alias); 13 Feb 2014 05:24:12 -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 17374 invoked by uid 48); 13 Feb 2014 05:24:07 -0000 From: "ppluzhnikov at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60167] New: [4.9 regression] Bogus error: conflicting declaration Date: Thu, 13 Feb 2014 05:24: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: ppluzhnikov at google dot com 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-02/txt/msg01182.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60167 Bug ID: 60167 Summary: [4.9 regression] Bogus error: conflicting declaration Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppluzhnikov at google dot com The test case below fails to compile with current trunk: g++ (GCC) 4.9.0 20140213 (experimental) g++ -c t.cc t.cc:10:48: error: conflicting declaration =E2=80=98typename Foo::Bar Fo= o::cache=E2=80=99 template typename Foo::Bar Foo::cache; ^ t.cc:5:14: note: previous declaration as =E2=80=98Foo::Bar Foo::cache= =E2=80=99 static Bar cache; ^ t.cc:10:48: error: declaration of =E2=80=98Foo::Bar Foo::cache=E2=80= =99 outside of class is not definition [-fpermissive] template typename Foo::Bar Foo::cache; ^ /// --- cut --- template struct Foo { typedef int Bar; static Bar cache; }; // template int Foo::cache; // OK template typename Foo::Bar Foo::cache; /// --- cut --- Removing reference (template struct Foo) also makes it compile. Compiles fine with gcc-4.8 and Clang. >>From gcc-bugs-return-443426-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 13 05:40:15 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 16380 invoked by alias); 13 Feb 2014 05:40:15 -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 16344 invoked by uid 48); 13 Feb 2014 05:40:10 -0000 From: "ashish.sadanandan at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60168] New: Incorrect check in ~unique_ptr() when Deleter::pointer type is not a pointer type Date: Thu, 13 Feb 2014 05:40: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: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ashish.sadanandan at gmail dot com 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg01183.txt.bz2 Content-length: 1091 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60168 Bug ID: 60168 Summary: Incorrect check in ~unique_ptr() when Deleter::pointer type is not a pointer type Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ashish.sadanandan at gmail dot com The following compiles on both VS2013 and ICC 13.0.1 #include struct del { using pointer = int; void operator()(int) {} }; int main() { std::unique_ptr p; } It fails on gcc4.8.1 with this error /usr/include/c++/4.8/bits/unique_ptr.h: In instantiation of 'std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = int; _Dp = del]': main.cpp:13:35: required from here /usr/include/c++/4.8/bits/unique_ptr.h:183:12: error: invalid operands of types 'int' and 'std::nullptr_t' to binary 'operator!=' if (__ptr != nullptr) I believe that last if statement should be if (__ptr != pointer())