[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2008-08-21 Thread paolo dot carlini at oracle dot com


--- Comment #16 from paolo dot carlini at oracle dot com  2008-08-21 12:04 
---
*** Bug 36430 has been marked as a duplicate of this bug. ***


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 CC||gbrammer at gmx dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-10-13 Thread simartin at gcc dot gnu dot org


--- Comment #14 from simartin at gcc dot gnu dot org  2007-10-13 06:05 
---
Subject: Bug 26698

Author: simartin
Date: Sat Oct 13 06:04:57 2007
New Revision: 129282

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=129282
Log:
gcc/cp/

2007-10-13  Simon Martin  [EMAIL PROTECTED]

PR c++/26698
* call.c (build_user_type_conversion_1): Do not consider conversion
functions to convert a (possibly cv-qualified) object to the (possibly
cv-qualified) same object type (or a reference to it), to a (possibly
cv-qualified) base class of that type (or a reference to it).

gcc/testsuite/

2007-10-13  Simon Martin  [EMAIL PROTECTED]

PR c++/26698
* g++.dg/conversion/op4.C: New test.

Added:
branches/gcc-4_2-branch/gcc/testsuite/g++.dg/conversion/op4.C
Modified:
branches/gcc-4_2-branch/gcc/cp/ChangeLog
branches/gcc-4_2-branch/gcc/cp/call.c
branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-10-13 Thread simartin at gcc dot gnu dot org


--- Comment #15 from simartin at gcc dot gnu dot org  2007-10-13 06:17 
---
Fixed on all the active branches.


-- 

simartin at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-10-12 Thread simartin at gcc dot gnu dot org


--- Comment #13 from simartin at gcc dot gnu dot org  2007-10-12 18:43 
---
Subject: Bug 26698

Author: simartin
Date: Fri Oct 12 18:43:33 2007
New Revision: 129274

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=129274
Log:
gcc/cp/

2007-10-12  Simon Martin  [EMAIL PROTECTED]

PR c++/26698
* call.c (build_user_type_conversion_1): Do not consider conversion
functions to convert a (possibly cv-qualified) object to the (possibly
cv-qualified) same object type (or a reference to it), to a (possibly
cv-qualified) base class of that type (or a reference to it).

gcc/testsuite/

2007-10-12  Simon Martin  [EMAIL PROTECTED]

PR c++/26698
* g++.dg/conversion/op4.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/conversion/op4.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-10-07 Thread patchapp at dberlin dot org


--- Comment #12 from patchapp at dberlin dot org  2007-10-07 19:50 ---
Subject: Bug number PR c++/26698

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00379.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-10-02 Thread pcarlini at suse dot de


--- Comment #11 from pcarlini at suse dot de  2007-10-02 15:47 ---
By the way, confirmed the return *new X point.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-09-07 Thread mmitchel at gcc dot gnu dot org


--- Comment #10 from mmitchel at gcc dot gnu dot org  2007-09-07 23:50 
---
It looks to me that the change I made in Comment #5 was just an optimization;
the warning was already conditionalized on warn_conversion.  I just
short-circuited the checking sooner.  Declaring the conversion function is not
illegal, so I think it's OK that we only warn conditionally.

It's true that we should never use the conversion function.  The error we're
getting now is just a consequence of the body of the conversion function; if we
put return *new X in there, it would compile file, and we probably wouldn't
get an error about the program, even though it's still invalid.

So, I do think that there's a bug somewhere; we shouldn't be considering this
conversion operator when calling add_one.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-09-06 Thread pcarlini at suse dot de


--- Comment #8 from pcarlini at suse dot de  2007-09-07 00:36 ---
Mark?


-- 

pcarlini at suse dot de changed:

   What|Removed |Added

 CC||mark at codesourcery dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-09-06 Thread pcarlini at suse dot de


--- Comment #7 from pcarlini at suse dot de  2007-09-07 00:34 ---
Now in mainline things are better:

26698.C: In member function ‘X::operator X() const’:
26698.C:25: error: invalid initialization of reference of type ‘X’ from
expression of type ‘const X’

I'm not sure whether an error at line 28 is mandatory together with the above
one.


-- 

pcarlini at suse dot de changed:

   What|Removed |Added

 CC||pcarlini at suse dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-09-06 Thread pcarlini at suse dot de


--- Comment #9 from pcarlini at suse dot de  2007-09-07 00:39 ---
Meant line *38* of course, sorry.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-02-14 Thread mmitchel at gcc dot gnu dot org


-- 

mmitchel at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.1.2   |4.1.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-02-03 Thread gdr at gcc dot gnu dot org


--- Comment #6 from gdr at gcc dot gnu dot org  2007-02-03 16:24 ---
Won't fix in GCC-4.0.x.  Adjustine milestone.


-- 

gdr at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|4.0.4   |---


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698



[Bug c++/26698] [4.0/4.1/4.2/4.3 Regression] g++ accepts const-incorrect code due to conversion function

2007-02-03 Thread jsm28 at gcc dot gnu dot org


-- 

jsm28 at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26698