public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47080] New: explicit conversion function return conversions not restricted to qualifications
@ 2010-12-28 18:20 schaub.johannes at googlemail dot com
  2010-12-28 19:10 ` [Bug c++/47080] " schaub.johannes at googlemail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: schaub.johannes at googlemail dot com @ 2010-12-28 18:20 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: explicit conversion function return conversions not
                    restricted to qualifications
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: schaub.johannes@googlemail.com


n3225 only allows a qualification conversion for the return of an explicit
conversion function when converting to a non-class type:

struct A {
  explicit operator int();
};

int main() {
  bool b((A())); // should not work
  !A(); // should not work!
}

Both are not valid according to 13.3.1.5/1 (second case uses candidate function
provided by 13.6/23, for which the bool parameter uses contextual conversion).
GCC accepts both.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-20 14:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-28 18:20 [Bug c++/47080] New: explicit conversion function return conversions not restricted to qualifications schaub.johannes at googlemail dot com
2010-12-28 19:10 ` [Bug c++/47080] " schaub.johannes at googlemail dot com
2011-06-20  4:11 ` [Bug c++/47080] [C++0x] " jason at gcc dot gnu.org
2011-06-20 14:43 ` jason at gcc dot gnu.org
2011-06-20 14:45 ` 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).