public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/60167] New: [4.9 regression] Bogus error: conflicting declaration
@ 2014-02-13 5:24 ppluzhnikov at google dot com
2014-02-21 5:05 ` [Bug c++/60167] [4.8/4.9 " jason at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: ppluzhnikov at google dot com @ 2014-02-13 5:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60167
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 ‘typename Foo<F>::Bar Foo<F>::cache’
template <int& F> typename Foo<F>::Bar Foo<F>::cache;
^
t.cc:5:14: note: previous declaration as ‘Foo<F>::Bar Foo<F>::cache’
static Bar cache;
^
t.cc:10:48: error: declaration of ‘Foo<F>::Bar Foo<F>::cache’ outside of class
is not definition [-fpermissive]
template <int& F> typename Foo<F>::Bar Foo<F>::cache;
^
/// --- cut ---
template <int& F>
struct Foo {
typedef int Bar;
static Bar cache;
};
// template <int& F> int Foo<F>::cache; // OK
template <int& F> typename Foo<F>::Bar Foo<F>::cache;
/// --- cut ---
Removing reference (template <int F> 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: <gcc-bugs-return-443426-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
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: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
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" <gcc-bugzilla@gcc.gnu.org>
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: <bug-60168-4@http.gcc.gnu.org/bugzilla/>
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`168
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 <memory>
struct del
{
using pointer = int;
void operator()(int) {}
};
int main()
{
std::unique_ptr<int, del> 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())
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/60167] [4.8/4.9 regression] Bogus error: conflicting declaration 2014-02-13 5:24 [Bug c++/60167] New: [4.9 regression] Bogus error: conflicting declaration ppluzhnikov at google dot com @ 2014-02-21 5:05 ` jason at gcc dot gnu.org 2014-02-21 5:05 ` jason at gcc dot gnu.org ` (5 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: jason at gcc dot gnu.org @ 2014-02-21 5:05 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60167 Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ondrej.kolacek1 at centrum dot cz --- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> --- *** Bug 60274 has been marked as a duplicate of this bug. *** ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/60167] [4.8/4.9 regression] Bogus error: conflicting declaration 2014-02-13 5:24 [Bug c++/60167] New: [4.9 regression] Bogus error: conflicting declaration ppluzhnikov at google dot com 2014-02-21 5:05 ` [Bug c++/60167] [4.8/4.9 " jason at gcc dot gnu.org @ 2014-02-21 5:05 ` jason at gcc dot gnu.org 2014-02-21 13:31 ` [Bug c++/60167] [4.9 " jason at gcc dot gnu.org ` (4 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: jason at gcc dot gnu.org @ 2014-02-21 5:05 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60167 Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/60167] [4.9 regression] Bogus error: conflicting declaration 2014-02-13 5:24 [Bug c++/60167] New: [4.9 regression] Bogus error: conflicting declaration ppluzhnikov at google dot com 2014-02-21 5:05 ` [Bug c++/60167] [4.8/4.9 " jason at gcc dot gnu.org 2014-02-21 5:05 ` jason at gcc dot gnu.org @ 2014-02-21 13:31 ` jason at gcc dot gnu.org 2014-02-21 14:01 ` jason at gcc dot gnu.org ` (3 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: jason at gcc dot gnu.org @ 2014-02-21 13:31 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60167 Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.8.3 |4.9.0 Summary|[4.8/4.9 regression] Bogus |[4.9 regression] Bogus |error: conflicting |error: conflicting |declaration |declaration --- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> --- Fixed in 4.8 by reverting the 58606 patch. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/60167] [4.9 regression] Bogus error: conflicting declaration 2014-02-13 5:24 [Bug c++/60167] New: [4.9 regression] Bogus error: conflicting declaration ppluzhnikov at google dot com ` (2 preceding siblings ...) 2014-02-21 13:31 ` [Bug c++/60167] [4.9 " jason at gcc dot gnu.org @ 2014-02-21 14:01 ` jason at gcc dot gnu.org 2014-02-21 14:29 ` jakub at gcc dot gnu.org ` (2 subsequent siblings) 6 siblings, 0 replies; 8+ messages in thread From: jason at gcc dot gnu.org @ 2014-02-21 14:01 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60167 --- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Fri Feb 21 14:00:44 2014 New Revision: 207994 URL: http://gcc.gnu.org/viewcvs?rev=207994&root=gcc&view=rev Log: PR c++/60167 PR c++/60222 PR c++/58606 * parser.c (cp_parser_template_argument): Restore dereference. * pt.c (template_parm_to_arg): Dereference non-pack expansions too. (process_partial_specialization): Handle deref. (unify): Likewise. Added: trunk/gcc/testsuite/g++.dg/template/ref7.C trunk/gcc/testsuite/g++.dg/template/ref8.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/cp/pt.c ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/60167] [4.9 regression] Bogus error: conflicting declaration 2014-02-13 5:24 [Bug c++/60167] New: [4.9 regression] Bogus error: conflicting declaration ppluzhnikov at google dot com ` (3 preceding siblings ...) 2014-02-21 14:01 ` jason at gcc dot gnu.org @ 2014-02-21 14:29 ` jakub at gcc dot gnu.org 2014-02-21 21:07 ` reichelt at gcc dot gnu.org 2014-07-31 15:55 ` jason at gcc dot gnu.org 6 siblings, 0 replies; 8+ messages in thread From: jakub at gcc dot gnu.org @ 2014-02-21 14:29 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60167 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Fixed then. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/60167] [4.9 regression] Bogus error: conflicting declaration 2014-02-13 5:24 [Bug c++/60167] New: [4.9 regression] Bogus error: conflicting declaration ppluzhnikov at google dot com ` (4 preceding siblings ...) 2014-02-21 14:29 ` jakub at gcc dot gnu.org @ 2014-02-21 21:07 ` reichelt at gcc dot gnu.org 2014-07-31 15:55 ` jason at gcc dot gnu.org 6 siblings, 0 replies; 8+ messages in thread From: reichelt at gcc dot gnu.org @ 2014-02-21 21:07 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60167 Bug 60167 depends on bug 58606, which changed state. Bug 58606 Summary: [4.8 Regression] [c++11] ICE with specialization in variadic template http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58606 What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |--- ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/60167] [4.9 regression] Bogus error: conflicting declaration 2014-02-13 5:24 [Bug c++/60167] New: [4.9 regression] Bogus error: conflicting declaration ppluzhnikov at google dot com ` (5 preceding siblings ...) 2014-02-21 21:07 ` reichelt at gcc dot gnu.org @ 2014-07-31 15:55 ` jason at gcc dot gnu.org 6 siblings, 0 replies; 8+ messages in thread From: jason at gcc dot gnu.org @ 2014-07-31 15:55 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60167 Bug 60167 depends on bug 58606, which changed state. Bug 58606 Summary: [4.8 Regression] [c++11] ICE with specialization in variadic template https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58606 What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution|--- |FIXED ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-07-31 15:55 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-02-13 5:24 [Bug c++/60167] New: [4.9 regression] Bogus error: conflicting declaration ppluzhnikov at google dot com 2014-02-21 5:05 ` [Bug c++/60167] [4.8/4.9 " jason at gcc dot gnu.org 2014-02-21 5:05 ` jason at gcc dot gnu.org 2014-02-21 13:31 ` [Bug c++/60167] [4.9 " jason at gcc dot gnu.org 2014-02-21 14:01 ` jason at gcc dot gnu.org 2014-02-21 14:29 ` jakub at gcc dot gnu.org 2014-02-21 21:07 ` reichelt at gcc dot gnu.org 2014-07-31 15:55 ` jason at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).