This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
- From: "tom at kera dot name" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Aug 2009 14:48:55 -0000
- Subject: [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
- References: <bug-40942-629@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from tom at kera dot name 2009-08-25 14:48 -------
(In reply to comment #2)
> Why would this be ambiguous? A string literal has type "array of n const char"
> (see 2.13.4/1), so it should go with the array constructor. Do you disagree?
>
> W.
>
Table 9 under 13.3.3/1 shows that array-to-pointer conversion is Exact Match.
As is rvalue-to-lvalue conversion (though string literals are lvalues anyway
:D). As is Identity, which is what applies here.
There is no clear ranking between them, hence Comeau reporting ambiguity.
Although I personally think Identity should overrule absolutely everything, it
doesn't. So IMO GCC is buggy in this way.
--
tom at kera dot name changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tom at kera dot name
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40942