public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44909] New: Copy constructors implicitly deleted
@ 2010-07-11 13:54 marc dot glisse at normalesup dot org
2010-07-13 22:24 ` [Bug c++/44909] [C++0x] " jason at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 11+ messages in thread
From: marc dot glisse at normalesup dot org @ 2010-07-11 13:54 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]
The following code compiles fine in C++98 with any version of g++, compiles
fine in C++0X with g++-4.4, but fails in C++0X with g++-4.6 with the error
message:
bug.cc: In function void ouin(const Ray&):
bug.cc:35:9: error: use of deleted function Ray::Ray(const Ray&)
bug.cc:28:8: error: Ray::Ray(const Ray&) is implicitly deleted because the
default definition would be ill-formed:
I hope I didn't remove anything essential while reducing the example (started
with 500k lines...).
struct Coord
{
Coord();
Coord(const Coord&);
};
template<typename _Tp>
struct array
{
array();
_Tp _M_instance[1];
};
struct Ray;
struct Vector
{
array<Coord> base;
Vector();
Vector(const Ray &) ;
};
struct Point
{
Vector base;
};
struct Ray
{
array<Point> base;
};
void ouin (Ray const& r1)
{
Ray r2=r1;
}
--
Summary: Copy constructors implicitly deleted
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: marc dot glisse at normalesup dot org
GCC host triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44909
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/44909] [C++0x] Copy constructors implicitly deleted
2010-07-11 13:54 [Bug c++/44909] New: Copy constructors implicitly deleted marc dot glisse at normalesup dot org
@ 2010-07-13 22:24 ` jason at gcc dot gnu dot org
2010-07-14 0:02 ` jason at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-07-13 22:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from jason at gcc dot gnu dot org 2010-07-13 22:24 -------
Subject: Bug 44909
Author: jason
Date: Tue Jul 13 22:23:49 2010
New Revision: 162159
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162159
Log:
PR c++/44909
* cp-tree.h (struct lang_type_class): Add has_user_opeq.
(TYPE_HAS_USER_OPEQ): New.
* decl.c (grok_special_member_properties): Set it.
* class.c (add_implicitly_declared_members): Don't lazily declare
constructors/operator= if a base or member has a user-declared one.
(check_bases_and_members, check_bases): Adjust.
(check_field_decls, check_field_decl): Adjust.
* method.c (synthesized_method_walk): Initialize check_vdtor.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/implicit6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/class.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/method.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/parse/error28.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44909
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/44909] [C++0x] Copy constructors implicitly deleted
2010-07-11 13:54 [Bug c++/44909] New: Copy constructors implicitly deleted marc dot glisse at normalesup dot org
2010-07-13 22:24 ` [Bug c++/44909] [C++0x] " jason at gcc dot gnu dot org
@ 2010-07-14 0:02 ` jason at gcc dot gnu dot org
2010-07-14 14:08 ` marc dot glisse at normalesup dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-07-14 0:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jason at gcc dot gnu dot org 2010-07-14 00:01 -------
Fixed.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.6.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44909
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/44909] [C++0x] Copy constructors implicitly deleted
2010-07-11 13:54 [Bug c++/44909] New: Copy constructors implicitly deleted marc dot glisse at normalesup dot org
2010-07-13 22:24 ` [Bug c++/44909] [C++0x] " jason at gcc dot gnu dot org
2010-07-14 0:02 ` jason at gcc dot gnu dot org
@ 2010-07-14 14:08 ` marc dot glisse at normalesup dot org
2010-07-14 14:15 ` marc dot glisse at normalesup dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: marc dot glisse at normalesup dot org @ 2010-07-14 14:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from marc dot glisse at normalesup dot org 2010-07-14 14:08 -------
Created an attachment (id=21199)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21199&action=view)
extra testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44909
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/44909] [C++0x] Copy constructors implicitly deleted
2010-07-11 13:54 [Bug c++/44909] New: Copy constructors implicitly deleted marc dot glisse at normalesup dot org
` (2 preceding siblings ...)
2010-07-14 14:08 ` marc dot glisse at normalesup dot org
@ 2010-07-14 14:15 ` marc dot glisse at normalesup dot org
2010-07-14 14:30 ` paolo dot carlini at oracle dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: marc dot glisse at normalesup dot org @ 2010-07-14 14:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from marc dot glisse at normalesup dot org 2010-07-14 14:14 -------
The patch (or another one committed recently) seems to have broken the attached
testcase (as you can see from the names, this comes from the same code),
including in C++98 mode. If it is unrelated, sorry for adding it to this bug
instead of creating a new one.
(I am not reopening the bug, you probably know better than me what the
appropriate action is)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44909
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/44909] [C++0x] Copy constructors implicitly deleted
2010-07-11 13:54 [Bug c++/44909] New: Copy constructors implicitly deleted marc dot glisse at normalesup dot org
` (3 preceding siblings ...)
2010-07-14 14:15 ` marc dot glisse at normalesup dot org
@ 2010-07-14 14:30 ` paolo dot carlini at oracle dot com
2010-07-14 14:45 ` paolo dot carlini at oracle dot com
2010-07-15 20:46 ` jason at gcc dot gnu dot org
6 siblings, 0 replies; 11+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-07-14 14:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from paolo dot carlini at oracle dot com 2010-07-14 14:30 -------
I can confirm the new testcase doesn't compile anymore. Let's re-open this PR
to be safe.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44909
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/44909] [C++0x] Copy constructors implicitly deleted
2010-07-11 13:54 [Bug c++/44909] New: Copy constructors implicitly deleted marc dot glisse at normalesup dot org
` (4 preceding siblings ...)
2010-07-14 14:30 ` paolo dot carlini at oracle dot com
@ 2010-07-14 14:45 ` paolo dot carlini at oracle dot com
2010-07-15 20:46 ` jason at gcc dot gnu dot org
6 siblings, 0 replies; 11+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-07-14 14:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from paolo dot carlini at oracle dot com 2010-07-14 14:45 -------
I can also confirm that r162158 accepted zut.cc and r162159 doesn't.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44909
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/44909] [C++0x] Copy constructors implicitly deleted
2010-07-11 13:54 [Bug c++/44909] New: Copy constructors implicitly deleted marc dot glisse at normalesup dot org
` (5 preceding siblings ...)
2010-07-14 14:45 ` paolo dot carlini at oracle dot com
@ 2010-07-15 20:46 ` jason at gcc dot gnu dot org
6 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-07-15 20:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jason at gcc dot gnu dot org 2010-07-15 20:45 -------
Subject: Bug 44909
Author: jason
Date: Thu Jul 15 20:45:35 2010
New Revision: 162233
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162233
Log:
PR c++/44909
* call.c (add_function_candidate): If we're working on an implicit
declaration, don't consider candidates that won't match.
* typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
* cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
Revert:
* cp-tree.h (struct lang_type_class): Add has_user_opeq.
(TYPE_HAS_USER_OPEQ): New.
* decl.c (grok_special_member_properties): Set it.
* class.c (add_implicitly_declared_members): Don't lazily declare
constructors/operator= if a base or member has a user-declared one.
(check_bases_and_members, check_bases): Adjust.
(check_field_decls, check_field_decl): Adjust.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/implicit7.C
trunk/gcc/testsuite/g++.dg/cpp0x/implicit8.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/class.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/implicit6.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44909
^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <bug-44909-4@http.gcc.gnu.org/bugzilla/>]
end of thread, other threads:[~2011-03-14 5:09 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-11 13:54 [Bug c++/44909] New: Copy constructors implicitly deleted marc dot glisse at normalesup dot org
2010-07-13 22:24 ` [Bug c++/44909] [C++0x] " jason at gcc dot gnu dot org
2010-07-14 0:02 ` jason at gcc dot gnu dot org
2010-07-14 14:08 ` marc dot glisse at normalesup dot org
2010-07-14 14:15 ` marc dot glisse at normalesup dot org
2010-07-14 14:30 ` paolo dot carlini at oracle dot com
2010-07-14 14:45 ` paolo dot carlini at oracle dot com
2010-07-15 20:46 ` jason at gcc dot gnu dot org
[not found] <bug-44909-4@http.gcc.gnu.org/bugzilla/>
2011-01-27 7:04 ` hjl.tools at gmail dot com
2011-01-27 15:21 ` jason at gcc dot gnu.org
2011-03-14 5:09 ` 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).