public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54442] New: Const overloads resolution failure
@ 2012-08-31 19:40 nikkoara at hates dot ms
  2012-08-31 20:14 ` [Bug c++/54442] " daniel.kruegler at googlemail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: nikkoara at hates dot ms @ 2012-08-31 19:40 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54442
           Summary: Const overloads resolution failure
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nikkoara@hates.ms


gcc fails to take address of const overloads, possibly confused by the index_t
typedef:

$ gcc -v; cat t.cpp; gcc -c t.cpp
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/gcc/4_7_1/libexec/gcc/x86_64-slackware-linux/4.7.1/lto-wrapper
Target: x86_64-slackware-linux
Configured with: ../gcc-4.7.1/configure --prefix=/opt/gcc/4_7_1
--libdir=/opt/gcc/4_7_1/lib64 --enable-languages=c,c++ --enable-threads=posix
--enable-shared --enable-checking=release --with-system-zlib
--disable-libunwind-exceptions --enable-__cxa_atexit
--target=x86_64-slackware-linux --build=x86_64-slackware-linux
--host=x86_64-slackware-linux --enable-multilib
Thread model: posix
gcc version 4.7.1 (GCC) 
namespace X {

struct S
{
    void s (int) const throw ();
    void s (int) throw ();
};

}

extern "C" {
typedef int index_t;
}

namespace X {
using ::index_t;
} 

void (X::S::*f) (X::index_t) = &X::S::s;
void (X::S::*g) (X::index_t) const = &X::S::s;

t.cpp:20:45: error: no matches converting function 's' to type 'void (struct
X::S::*)(index_t)const {aka void (struct X::S::*)(int)const}'
t.cpp:6:10: error: candidates are: void X::S::s(int)
t.cpp:5:10: error:                 void X::S::s(int) const


Thanks.

Liviu


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

* [Bug c++/54442] Const overloads resolution failure
  2012-08-31 19:40 [Bug c++/54442] New: Const overloads resolution failure nikkoara at hates dot ms
@ 2012-08-31 20:14 ` daniel.kruegler at googlemail dot com
  2012-08-31 20:41 ` glisse at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-08-31 20:14 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-08-31 20:13:42 UTC ---
For gcc 4.8.0 20120819 (experimental) I'm getting an ICE instead:

"20|internal compiler error: canonical types differ for identical types
void(index_t)__attribute__((const)) {aka void(int)__attribute__((const)) throw
()} and void(int)__attribute__((const)) throw ()"


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

* [Bug c++/54442] Const overloads resolution failure
  2012-08-31 19:40 [Bug c++/54442] New: Const overloads resolution failure nikkoara at hates dot ms
  2012-08-31 20:14 ` [Bug c++/54442] " daniel.kruegler at googlemail dot com
@ 2012-08-31 20:41 ` glisse at gcc dot gnu.org
  2014-06-09 15:08 ` glisse at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-08-31 20:41 UTC (permalink / raw)
  To: gcc-bugs

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

Marc Glisse <glisse at gcc dot gnu.org> changed:

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

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> 2012-08-31 20:40:55 UTC ---
"using" and "extern"C"" are not guilty:

struct S
{
  void s (int) const throw ();
  void s (int) throw ();
};

typedef int index_t;

void (S::*f) (index_t)       = &S::s;
void (S::*g) (index_t) const = &S::s;

The bogus pretty printing with attribute((const)) is PR 48665.


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

* [Bug c++/54442] Const overloads resolution failure
  2012-08-31 19:40 [Bug c++/54442] New: Const overloads resolution failure nikkoara at hates dot ms
  2012-08-31 20:14 ` [Bug c++/54442] " daniel.kruegler at googlemail dot com
  2012-08-31 20:41 ` glisse at gcc dot gnu.org
@ 2014-06-09 15:08 ` glisse at gcc dot gnu.org
  2014-12-14 15:32 ` ville.voutilainen at gmail dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-06-09 15:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
Author: glisse
Date: Mon Jun  9 15:07:24 2014
New Revision: 211377

URL: http://gcc.gnu.org/viewcvs?rev=211377&root=gcc&view=rev
Log:
2014-06-09  Marc Glisse  <marc.glisse@inria.fr>

    PR c++/54442
gcc/
    * tree.c (build_qualified_type): Use a canonical type for
    TYPE_CANONICAL.
gcc/testsuite/
    * g++.dg/pr54442.C: New file.

Added:
    trunk/gcc/testsuite/g++.dg/pr54442.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree.c


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

* [Bug c++/54442] Const overloads resolution failure
  2012-08-31 19:40 [Bug c++/54442] New: Const overloads resolution failure nikkoara at hates dot ms
                   ` (2 preceding siblings ...)
  2014-06-09 15:08 ` glisse at gcc dot gnu.org
@ 2014-12-14 15:32 ` ville.voutilainen at gmail dot com
  2014-12-18 22:49 ` [Bug c++/54442] [4.8/4.9 Regression] " reichelt at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ville.voutilainen at gmail dot com @ 2014-12-14 15:32 UTC (permalink / raw)
  To: gcc-bugs

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

Ville Voutilainen <ville.voutilainen at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ville.voutilainen at gmail dot com
      Known to work|4.10.0                      |5.0

--- Comment #4 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
I guess this should be closed as fixed, unless this will be backported to 4.9?


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

* [Bug c++/54442] [4.8/4.9 Regression] Const overloads resolution failure
  2012-08-31 19:40 [Bug c++/54442] New: Const overloads resolution failure nikkoara at hates dot ms
                   ` (3 preceding siblings ...)
  2014-12-14 15:32 ` ville.voutilainen at gmail dot com
@ 2014-12-18 22:49 ` reichelt at gcc dot gnu.org
  2014-12-19 13:35 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-12-18 22:49 UTC (permalink / raw)
  To: gcc-bugs

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

Volker Reichelt <reichelt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.2.0, 4.3.0, 4.4.0
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2014-12-18
                 CC|                            |reichelt at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|Const overloads resolution  |[4.8/4.9 Regression] Const
                   |failure                     |overloads resolution
                   |                            |failure
   Target Milestone|---                         |4.8.4
      Known to fail|                            |4.5.0, 4.6.0, 4.7.0, 4.8.0

--- Comment #5 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
Marc's testcase from comment#2 demonstrates a regression that was introduced in
GCC 4.5.0.


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

* [Bug c++/54442] [4.8/4.9 Regression] Const overloads resolution failure
  2012-08-31 19:40 [Bug c++/54442] New: Const overloads resolution failure nikkoara at hates dot ms
                   ` (4 preceding siblings ...)
  2014-12-18 22:49 ` [Bug c++/54442] [4.8/4.9 Regression] " reichelt at gcc dot gnu.org
@ 2014-12-19 13:35 ` jakub at gcc dot gnu.org
  2015-01-13 23:40 ` paolo at gcc dot gnu.org
  2015-01-13 23:41 ` [Bug c++/54442] [4.8 " paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-19 13:35 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.4                       |4.8.5

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.4 has been released.


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

* [Bug c++/54442] [4.8/4.9 Regression] Const overloads resolution failure
  2012-08-31 19:40 [Bug c++/54442] New: Const overloads resolution failure nikkoara at hates dot ms
                   ` (5 preceding siblings ...)
  2014-12-19 13:35 ` jakub at gcc dot gnu.org
@ 2015-01-13 23:40 ` paolo at gcc dot gnu.org
  2015-01-13 23:41 ` [Bug c++/54442] [4.8 " paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-01-13 23:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Tue Jan 13 23:39:24 2015
New Revision: 219566

URL: https://gcc.gnu.org/viewcvs?rev=219566&root=gcc&view=rev
Log:
gcc/
2015-01-13  Marc Glisse  <marc.glisse@inria.fr>

    PR c++/54442
    * tree.c (build_qualified_type): Use a canonical type for
    TYPE_CANONICAL.

testsuite/
2015-01-13  Marc Glisse  <marc.glisse@inria.fr>

    PR c++/54442
    * g++.dg/pr54442.C: New file.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/pr54442.C
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_9-branch/gcc/tree.c


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

* [Bug c++/54442] [4.8 Regression] Const overloads resolution failure
  2012-08-31 19:40 [Bug c++/54442] New: Const overloads resolution failure nikkoara at hates dot ms
                   ` (6 preceding siblings ...)
  2015-01-13 23:40 ` paolo at gcc dot gnu.org
@ 2015-01-13 23:41 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-01-13 23:41 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|4.8.5                       |4.9.3
            Summary|[4.8/4.9 Regression] Const  |[4.8 Regression] Const
                   |overloads resolution        |overloads resolution
                   |failure                     |failure

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.9.3 and 5.0.


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

end of thread, other threads:[~2015-01-13 23:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-31 19:40 [Bug c++/54442] New: Const overloads resolution failure nikkoara at hates dot ms
2012-08-31 20:14 ` [Bug c++/54442] " daniel.kruegler at googlemail dot com
2012-08-31 20:41 ` glisse at gcc dot gnu.org
2014-06-09 15:08 ` glisse at gcc dot gnu.org
2014-12-14 15:32 ` ville.voutilainen at gmail dot com
2014-12-18 22:49 ` [Bug c++/54442] [4.8/4.9 Regression] " reichelt at gcc dot gnu.org
2014-12-19 13:35 ` jakub at gcc dot gnu.org
2015-01-13 23:40 ` paolo at gcc dot gnu.org
2015-01-13 23:41 ` [Bug c++/54442] [4.8 " paolo.carlini at oracle dot com

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