public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56971] New: GCC claims a friend function to be overloaded, but it isn't
@ 2013-04-15 16:15 henning@still-hidden.de
  2013-04-15 16:19 ` [Bug c++/56971] " henning@still-hidden.de
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: henning@still-hidden.de @ 2013-04-15 16:15 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56971
           Summary: GCC claims a friend function to be overloaded, but it
                    isn't
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: henning@still-hidden.de


template <typename T>
class rp {
};

template <template <typename> class P>
struct b {
    template <class, template <typename> class FriendP>
    friend void f(b<FriendP> from);
};

template <class, template <typename> class P>
void f(b<P> from) {
}

int main() {
    b<rp> v;
    f<int>(v);
    return 0;
}

-----
> gcc map.cpp
main.cpp: In function 'int main()':
main.cpp:17:13: error: call of overloaded 'f(b<rp>&)' is ambiguous
     f<int>(v);
             ^
main.cpp:17:13: note: candidates are:
main.cpp:12:6: note: void f(b<P>) [with <template-parameter-1-1> = int; P = rp]
 void f(b<P> from) {
      ^
main.cpp:8:17: note: void f(b<FriendP>) [with <template-parameter-2-1> = int;
FriendP = rp; P = rp]
     friend void f(b<FriendP> from);
                 ^
-----

I can't see an overload here.


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

* [Bug c++/56971] GCC claims a friend function to be overloaded, but it isn't
  2013-04-15 16:15 [Bug c++/56971] New: GCC claims a friend function to be overloaded, but it isn't henning@still-hidden.de
@ 2013-04-15 16:19 ` henning@still-hidden.de
  2013-04-25 10:55 ` daniel.kruegler at googlemail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: henning@still-hidden.de @ 2013-04-15 16:19 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from henning@still-hidden.de 2013-04-15 16:19:21 UTC ---
> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/src/gcc-4.8-20130411/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--enable-gnu-unique-object --enable-linker-build-id --enable-cloog-backend=isl
--disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default
--enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu
--disable-install-libiberty --disable-multilib --disable-libssp
--disable-werror --enable-checking=release
Thread model: posix
gcc version 4.8.0 20130411 (prerelease) (GCC)


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

* [Bug c++/56971] GCC claims a friend function to be overloaded, but it isn't
  2013-04-15 16:15 [Bug c++/56971] New: GCC claims a friend function to be overloaded, but it isn't henning@still-hidden.de
  2013-04-15 16:19 ` [Bug c++/56971] " henning@still-hidden.de
@ 2013-04-25 10:55 ` daniel.kruegler at googlemail dot com
  2013-04-25 11:20 ` [Bug c++/56971] [4.9 Regression] " redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-04-25 10:55 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2013-04-25 10:55:08 UTC ---
For gcc 4.9.0 20130421 (experimental) this gives me an ICE:

"main.cpp|8|internal compiler error: canonical types differ for identical types
b<P> and b<FriendP>|"
>From gcc-bugs-return-420947-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Apr 25 11:04:35 2013
Return-Path: <gcc-bugs-return-420947-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1518 invoked by alias); 25 Apr 2013 11:04:35 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 1493 invoked by uid 48); 25 Apr 2013 11:04:32 -0000
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/56976] using braces to initialize a reference forces copy construction
Date: Thu, 25 Apr 2013 11:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: daniel.kruegler at googlemail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields: CC
Message-ID: <bug-56976-4-OEQGdG15XF@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56976-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56976-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg02092.txt.bz2
Content-length: 632


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

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> 2013-04-25 11:04:31 UTC ---
It seems to me as if you are observing the core language issue

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1604
>From gcc-bugs-return-420948-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Apr 25 11:04:46 2013
Return-Path: <gcc-bugs-return-420948-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2196 invoked by alias); 25 Apr 2013 11:04:46 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 2158 invoked by uid 48); 25 Apr 2013 11:04:43 -0000
From: "jb at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/57028] [4.9 regression] Fortran bootstrap fails due to missing zlib.h
Date: Thu, 25 Apr 2013 11:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jb at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: jb at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Changed-Fields: URL
Message-ID: <bug-57028-4-YDnKzofrXM@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57028-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57028-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg02093.txt.bz2
Content-length: 614


http://gcc.gnu.org/bugzilla/show_bug.cgi?idW028

Janne Blomqvist <jb at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|http://gcc.gnu.org/ml/gcc-p |http://gcc.gnu.org/ml/gcc-p
                   |atches/2013-04/msg01464.htm |atches/2013-04/msg01517.htm
                   |l                           |l

--- Comment #6 from Janne Blomqvist <jb at gcc dot gnu.org> 2013-04-25 11:04:42 UTC ---
Updated patch at http://gcc.gnu.org/ml/gcc-patches/2013-04/msg01517.html


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

* [Bug c++/56971] [4.9 Regression] GCC claims a friend function to be overloaded, but it isn't
  2013-04-15 16:15 [Bug c++/56971] New: GCC claims a friend function to be overloaded, but it isn't henning@still-hidden.de
  2013-04-15 16:19 ` [Bug c++/56971] " henning@still-hidden.de
  2013-04-25 10:55 ` daniel.kruegler at googlemail dot com
@ 2013-04-25 11:20 ` redi at gcc dot gnu.org
  2013-05-15 13:31 ` rguenth at gcc dot gnu.org
  2013-05-24 20:12 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2013-04-25 11:20 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-25
            Summary|GCC claims a friend         |[4.9 Regression] GCC claims
                   |function to be overloaded,  |a friend function to be
                   |but it isn't                |overloaded, but it isn't
     Ever Confirmed|0                           |1

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-04-25 11:20:33 UTC ---
ICE confirmed with trunk, which is a regression:

ice.c: In instantiation of 'struct b<rp>':
ice.c:16:11:   required from here
ice.c:8:17: internal compiler error: canonical types differ for identical types
b<P> and b<FriendP>
     friend void f(b<FriendP> from);
                 ^
0x64861b comptypes
        ../../gcc-4.9/gcc/cp/typeck.c:1395
0x64861b comptypes
        ../../gcc-4.9/gcc/cp/typeck.c:1369
0x649b33 compparms(tree_node const*, tree_node const*)
        ../../gcc-4.9/gcc/cp/typeck.c:1501
0x54526b decls_match(tree_node*, tree_node*)
        ../../gcc-4.9/gcc/cp/decl.c:1026
0x545cc4 duplicate_decls(tree_node*, tree_node*, bool)
        ../../gcc-4.9/gcc/cp/decl.c:1241
0x6e9801 push_overloaded_decl_1
        ../../gcc-4.9/gcc/cp/name-lookup.c:2288
0x6e9801 push_overloaded_decl
        ../../gcc-4.9/gcc/cp/name-lookup.c:2383
0x6eb1ed pushdecl_maybe_friend_1
        ../../gcc-4.9/gcc/cp/name-lookup.c:885
0x6eb1ed pushdecl_maybe_friend(tree_node*, bool)
        ../../gcc-4.9/gcc/cp/name-lookup.c:1219
0x6eca79 pushdecl_with_scope_1
        ../../gcc-4.9/gcc/cp/name-lookup.c:2206
0x6ed7ab pushdecl_with_scope(tree_node*, cp_binding_level*, bool)
        ../../gcc-4.9/gcc/cp/name-lookup.c:2220
0x6ed86d pushdecl_namespace_level(tree_node*, bool)
        ../../gcc-4.9/gcc/cp/name-lookup.c:3761
0x5b9e69 tsubst_friend_function
        ../../gcc-4.9/gcc/cp/pt.c:8137
0x5bb493 instantiate_class_template_1
        ../../gcc-4.9/gcc/cp/pt.c:8997
0x5bb493 instantiate_class_template(tree_node*)
        ../../gcc-4.9/gcc/cp/pt.c:9081
0x6439bb complete_type
        ../../gcc-4.9/gcc/cp/typeck.c:131
0x6439bb complete_type
        ../../gcc-4.9/gcc/cp/typeck.c:105
0x534f27 start_decl_1(tree_node*, bool)
        ../../gcc-4.9/gcc/cp/decl.c:4666
0x558990 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc-4.9/gcc/cp/decl.c:4629
0x618430 cp_parser_init_declarator
        ../../gcc-4.9/gcc/cp/parser.c:16138



4.6, 4.7 and 4.8 reject it, which is better than an ICE but possibly still
wrong.


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

* [Bug c++/56971] [4.9 Regression] GCC claims a friend function to be overloaded, but it isn't
  2013-04-15 16:15 [Bug c++/56971] New: GCC claims a friend function to be overloaded, but it isn't henning@still-hidden.de
                   ` (2 preceding siblings ...)
  2013-04-25 11:20 ` [Bug c++/56971] [4.9 Regression] " redi at gcc dot gnu.org
@ 2013-05-15 13:31 ` rguenth at gcc dot gnu.org
  2013-05-24 20:12 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-05-15 13:31 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.0


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

* [Bug c++/56971] [4.9 Regression] GCC claims a friend function to be overloaded, but it isn't
  2013-04-15 16:15 [Bug c++/56971] New: GCC claims a friend function to be overloaded, but it isn't henning@still-hidden.de
                   ` (3 preceding siblings ...)
  2013-05-15 13:31 ` rguenth at gcc dot gnu.org
@ 2013-05-24 20:12 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2013-05-24 20:12 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.9.


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

end of thread, other threads:[~2013-05-24 20:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-15 16:15 [Bug c++/56971] New: GCC claims a friend function to be overloaded, but it isn't henning@still-hidden.de
2013-04-15 16:19 ` [Bug c++/56971] " henning@still-hidden.de
2013-04-25 10:55 ` daniel.kruegler at googlemail dot com
2013-04-25 11:20 ` [Bug c++/56971] [4.9 Regression] " redi at gcc dot gnu.org
2013-05-15 13:31 ` rguenth at gcc dot gnu.org
2013-05-24 20:12 ` 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).