This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/43932] New: conditional operator can't convert 0 to pointer
- From: "joerg dot richter at pdv-fs dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Apr 2010 11:52:28 -0000
- Subject: [Bug c++/43932] New: conditional operator can't convert 0 to pointer
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat t.cc
void* func( bool b )
{
return b ? 0 : throw 5;
}
$ g++ -c t.cc
template.cc: In function 'void* func(bool)':
template.cc:3:24: error: invalid conversion from 'int' to 'void*'
Replace 'throw 5' with '0' and it compiles as expected.
--
Summary: conditional operator can't convert 0 to pointer
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: joerg dot richter at pdv-fs dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43932