public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
       [not found] <bug-40942-4@http.gcc.gnu.org/bugzilla/>
@ 2012-03-29 13:43 ` redi at gcc dot gnu.org
  2012-03-29 17:53 ` vhaisman at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2012-03-29 13:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-03-29
     Ever Confirmed|0                           |1

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-29 13:41:07 UTC ---
confirmed


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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
       [not found] <bug-40942-4@http.gcc.gnu.org/bugzilla/>
  2012-03-29 13:43 ` [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid redi at gcc dot gnu.org
@ 2012-03-29 17:53 ` vhaisman at gmail dot com
  2012-03-29 20:00 ` manu at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: vhaisman at gmail dot com @ 2012-03-29 17:53 UTC (permalink / raw)
  To: gcc-bugs

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

Václav Zeman <vhaisman at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|4.4.1                       |4.7.0

--- Comment #6 from Václav Zeman <vhaisman at gmail dot com> 2012-03-29 17:39:40 UTC ---
This still fails for gcc version 4.7.0 20120225.


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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
       [not found] <bug-40942-4@http.gcc.gnu.org/bugzilla/>
  2012-03-29 13:43 ` [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid redi at gcc dot gnu.org
  2012-03-29 17:53 ` vhaisman at gmail dot com
@ 2012-03-29 20:00 ` manu at gcc dot gnu.org
  2012-03-30 16:20 ` dodji at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: manu at gcc dot gnu.org @ 2012-03-29 20:00 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-03-29 19:58:34 UTC ---
Clang prints:

/tmp/webcompile/_25725_0.cc:15:5: error: call to constructor of 'S' is
ambiguous
  S s1 ("test");
    ^   ~~~~~~
/tmp/webcompile/_25725_0.cc:4:3: note: candidate constructor [with T = char]
  S (T const *)
  ^
/tmp/webcompile/_25725_0.cc:8:3: note: candidate constructor [with N = 5]
  S (char const (&)[N])
  ^
/tmp/webcompile/_25725_0.cc:1:8: note: candidate is the implicit copy
constructor
struct S
       ^
1 error generated.


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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
       [not found] <bug-40942-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2012-03-29 20:00 ` manu at gcc dot gnu.org
@ 2012-03-30 16:20 ` dodji at gcc dot gnu.org
  2012-03-31 17:07 ` dodji at seketeli dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-03-30 16:20 UTC (permalink / raw)
  To: gcc-bugs

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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |dodji at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
       [not found] <bug-40942-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2012-03-30 16:20 ` dodji at gcc dot gnu.org
@ 2012-03-31 17:07 ` dodji at seketeli dot org
  2012-04-02  8:53 ` dodji at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: dodji at seketeli dot org @ 2012-03-31 17:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from dodji at seketeli dot org <dodji at seketeli dot org> 2012-03-31 17:02:48 UTC ---
A candidate fix was posted to
http://gcc.gnu.org/ml/gcc-patches/2012-03/msg01993.html for review.


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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
       [not found] <bug-40942-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2012-03-31 17:07 ` dodji at seketeli dot org
@ 2012-04-02  8:53 ` dodji at gcc dot gnu.org
  2012-04-02  8:57 ` dodji at gcc dot gnu.org
  2021-08-23  7:24 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-04-02  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-04-02 08:51:30 UTC ---
Author: dodji
Date: Mon Apr  2 08:51:26 2012
New Revision: 186067

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186067
Log:
PR c++/40942 - Failure of template specialization partial ordering

gcc/cp/

    * pt.c (more_specialized_fn):  Don't apply decay conversion to
    types of function parameters.

gcc/testsuite/

    * g++.old-deja/g++.pt/spec40.C: Adjust to take the resolution of
    DR 214 in account.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.old-deja/g++.pt/spec40.C


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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
       [not found] <bug-40942-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2012-04-02  8:53 ` dodji at gcc dot gnu.org
@ 2012-04-02  8:57 ` dodji at gcc dot gnu.org
  2021-08-23  7:24 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-04-02  8:57 UTC (permalink / raw)
  To: gcc-bugs

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

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #10 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-04-02 08:56:24 UTC ---
Fixed in 4.8 (trunk).


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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
       [not found] <bug-40942-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2012-04-02  8:57 ` dodji at gcc dot gnu.org
@ 2021-08-23  7:24 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-23  7:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40942

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0

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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
  2009-08-02 14:48 [Bug c++/40942] New: " v dot haisman at sh dot cvut dot cz
                   ` (2 preceding siblings ...)
  2009-08-25 14:20 ` v dot haisman at sh dot cvut dot cz
@ 2009-08-25 14:49 ` tom at kera dot name
  3 siblings, 0 replies; 12+ messages in thread
From: tom at kera dot name @ 2009-08-25 14:49 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
  2009-08-02 14:48 [Bug c++/40942] New: " v dot haisman at sh dot cvut dot cz
  2009-08-04 12:55 ` [Bug c++/40942] " jwakely dot gcc at gmail dot com
  2009-08-25 13:25 ` bangerth at gmail dot com
@ 2009-08-25 14:20 ` v dot haisman at sh dot cvut dot cz
  2009-08-25 14:49 ` tom at kera dot name
  3 siblings, 0 replies; 12+ messages in thread
From: v dot haisman at sh dot cvut dot cz @ 2009-08-25 14:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from v dot haisman at sh dot cvut dot cz  2009-08-25 14:20 -------
(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.
> 
IANALL, but I think this might be the reason:

The conversion sequence for S (T const *) is array-to-pointer conversion as per
4.2. The conversion sequence for S (char const (&)[N]) is lvalue-to-rvalue
conversion. For both the ranks are the exact match and thus they are
indistinguishable conversion sequences as per 13.3.3.2?


-- 


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


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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
  2009-08-02 14:48 [Bug c++/40942] New: " v dot haisman at sh dot cvut dot cz
  2009-08-04 12:55 ` [Bug c++/40942] " jwakely dot gcc at gmail dot com
@ 2009-08-25 13:25 ` bangerth at gmail dot com
  2009-08-25 14:20 ` v dot haisman at sh dot cvut dot cz
  2009-08-25 14:49 ` tom at kera dot name
  3 siblings, 0 replies; 12+ messages in thread
From: bangerth at gmail dot com @ 2009-08-25 13:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bangerth at gmail dot com  2009-08-25 13:24 -------
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.


-- 

bangerth at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at gmail dot com


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


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

* [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid.
  2009-08-02 14:48 [Bug c++/40942] New: " v dot haisman at sh dot cvut dot cz
@ 2009-08-04 12:55 ` jwakely dot gcc at gmail dot com
  2009-08-25 13:25 ` bangerth at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: jwakely dot gcc at gmail dot com @ 2009-08-04 12:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jwakely dot gcc at gmail dot com  2009-08-04 12:48 -------
Testcase can be reduced to:

struct S
{
  template <typename T>
  S (T const *)
  { }

  template <size_t N>
  S (char const (&)[N])
  { }
};

int
main()
{
  S s1 ("test");
}

GCC still accepts this while Comeau rejects it.


-- 

jwakely dot gcc at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jwakely dot gcc at gmail dot
                   |                            |com


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


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

end of thread, other threads:[~2021-08-23  7:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-40942-4@http.gcc.gnu.org/bugzilla/>
2012-03-29 13:43 ` [Bug c++/40942] GCC accepts code that Comeau and MSVC deems invalid redi at gcc dot gnu.org
2012-03-29 17:53 ` vhaisman at gmail dot com
2012-03-29 20:00 ` manu at gcc dot gnu.org
2012-03-30 16:20 ` dodji at gcc dot gnu.org
2012-03-31 17:07 ` dodji at seketeli dot org
2012-04-02  8:53 ` dodji at gcc dot gnu.org
2012-04-02  8:57 ` dodji at gcc dot gnu.org
2021-08-23  7:24 ` pinskia at gcc dot gnu.org
2009-08-02 14:48 [Bug c++/40942] New: " v dot haisman at sh dot cvut dot cz
2009-08-04 12:55 ` [Bug c++/40942] " jwakely dot gcc at gmail dot com
2009-08-25 13:25 ` bangerth at gmail dot com
2009-08-25 14:20 ` v dot haisman at sh dot cvut dot cz
2009-08-25 14:49 ` tom at kera dot name

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).