[Bug c++/2316] g++ fails to overload on language linkage

2021-12-14 Thread eric-bugs at omnifarious dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #55 from eric-bugs at omnifarious dot org --- C++ may get an ABI change one of these days. It needs one in order to have a properly efficient unique_ptr. Since that ABI change would involve who calls destructors and C doesn't have destr

[Bug c++/2316] g++ fails to overload on language linkage

2018-01-09 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 Jonathan Wakely changed: What|Removed |Added CC||dan.cermak@cgc-instruments.

[Bug c++/2316] g++ fails to overload on language linkage

2014-04-21 Thread harald at gigawatt dot nl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #53 from Harald van Dijk --- (In reply to Marc Glisse from comment #52) > (In reply to Harald van Dijk from comment #51) > > extern "C" { void f(); } > > typedef void t(); > > t f, *g = f; // valid redeclaration of f, invalid initialisa

[Bug c++/2316] g++ fails to overload on language linkage

2014-03-08 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #52 from Marc Glisse --- (In reply to Harald van Dijk from comment #51) > Note that a consequence of this is that a function declaration that uses a > typedef may not be compatible with the typedef (I think): > > extern "C" { void f();

[Bug c++/2316] g++ fails to overload on language linkage

2014-03-07 Thread harald at gigawatt dot nl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #51 from Harald van Dijk --- (In reply to Marc Glisse from comment #49) > Fixing this particular issue should > not be too hard, there must be a place in the compiler that merges a number > of properties from the early declaration into

[Bug c++/2316] g++ fails to overload on language linkage

2014-03-02 Thread amylaar at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #50 from Jorn Wolfgang Rennecke --- (In reply to Marc Glisse from comment #49) > large pieces of my patch as nonsense). Fixing this particular issue should > not be too hard, there must be a place in the compiler that merges a number >

[Bug c++/2316] g++ fails to overload on language linkage

2014-03-01 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #49 from Marc Glisse --- (In reply to Harald van Dijk from comment #48) > I've been experimenting with this (although updated to more recent GCC), and > one issue I see, functionality-wise, is what happens when an extern "C" > function

[Bug c++/2316] g++ fails to overload on language linkage

2014-03-01 Thread harald at gigawatt dot nl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 Harald van Dijk changed: What|Removed |Added CC||harald at gigawatt dot nl --- Comment #4

[Bug c++/2316] g++ fails to overload on language linkage

2013-03-21 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 Andrew Pinski changed: What|Removed |Added CC||jed at 59A2 dot org --- Comment

[Bug c++/2316] g++ fails to overload on language linkage

2012-02-22 Thread xiaoyuanbo at yeah dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 xiaoyuanbo changed: What|Removed |Added CC||xiaoyuanbo at yeah dot net --- Comment #46 fr

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-04 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #45 from Marc Glisse 2012-01-04 13:06:10 UTC --- (In reply to comment #42) > Well, perhaps something like: > #ifdef __cplusplus > extern "C++" int __REDIRECT_NTH (pthread_create, (pthread_t *__restrict > __newthread, const pthread_attr

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-04 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #44 from Jonathan Wakely 2012-01-04 13:00:27 UTC --- (In reply to comment #42) > still I agree this would be terribly annoying for > everybody. Not everybody, only those who don't also use another compiler that already diagnoses it ;

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-04 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #43 from Marc Glisse 2012-01-04 12:51:55 UTC --- (In reply to comment #40) > Great! If all existing code is accepted with a warning that provides backwards > compatibility, but also allows conforming code to correctly overload on > lan

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-04 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #42 f

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-04 Thread bangerth at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 Wolfgang Bangerth changed: What|Removed |Added CC||bangerth at gmail dot com --- Comment

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-04 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #40 from Jonathan Wakely 2012-01-04 11:49:35 UTC --- Great! If all existing code is accepted with a warning that provides backwards compatibility, but also allows conforming code to correctly overload on language linkage - that sounds

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-04 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 Marc Glisse changed: What|Removed |Added Attachment #26214|0 |1 is obsolete|

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-02 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #38 from Marc Glisse 2012-01-02 10:39:35 UTC --- Thanks for the comments. (In reply to comment #36) > The library should overload qsort, then the libitm/clone.cc change wouldn't be > needed Indeed, that was the meaning of my comment

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-01 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #37 from Andrew Pinski 2012-01-02 02:30:17 UTC --- I think the change to tree.c should not be done as it is middle-end code. That should be in the C++ front-end specific code instead. That is the middle-end should not care about the

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-01 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #36 from Jonathan Wakely 2012-01-02 01:04:14 UTC --- The library should overload qsort, then the libitm/clone.cc change wouldn't be needed

[Bug c++/2316] g++ fails to overload on language linkage

2012-01-01 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 Marc Glisse changed: What|Removed |Added Attachment #25181|0 |1 is obsolete|

[Bug c++/2316] g++ fails to overload on language linkage

2011-09-15 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #34 from Marc Glisse 2011-09-15 16:53:33 UTC --- I posted a related demangler patch on gcc-patches a couple weeks ago, let me just link it from here so it doesn't get lost: http://gcc.gnu.org/ml/gcc-patches/2011-09/msg00231.html

[Bug c++/2316] g++ fails to overload on language linkage

2011-09-04 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #33 from Marc Glisse 2011-09-04 11:03:41 UTC --- And if you don't like errors saying that X can't be converted to X, you'll need something like the below. I don't think I'll go much further anytime soon (if someone else wants a go, tha

[Bug c++/2316] g++ fails to overload on language linkage

2011-09-03 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 Marc Glisse changed: What|Removed |Added Attachment #25140|0 |1 is obsolete|

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-31 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #31 from Marc Glisse 2011-08-31 13:40:28 UTC --- (In reply to comment #25) > (In reply to comment #23) > > I think you can do it with a alias-declaration in an extern "C" block: > > > > extern "C" { > > template > > using func_t

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-30 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #30 from Marc Glisse 2011-08-30 20:32:57 UTC --- (In reply to comment #29) > New version that works with typedefs (I was forgetting extern "C" in the > canonical type...). The patch also includes a workaround for __stoa. There > seems

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-30 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 Marc Glisse changed: What|Removed |Added Attachment #25134|0 |1 is obsolete|

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-30 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #28 from Marc Glisse 2011-08-30 12:34:20 UTC --- (In reply to comment #27) > this is DR13 btw > http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#13 > I don't know if that's been reconsidered now we have attributes Gah, I lo

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-30 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #27 from Jonathan Wakely 2011-08-30 12:19:23 UTC --- this is DR13 btw http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#13 I don't know if that's been reconsidered now we have attributes

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-30 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #26 from Jonathan Wakely 2011-08-30 12:17:47 UTC --- (In reply to comment #25) > (In reply to comment #23) > > > We could solve it with an alternative syntax for language linkage > > using attributes: > > > > void f( [[extern(C)]]

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-30 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #25 from Marc Glisse 2011-08-30 11:28:48 UTC --- (In reply to comment #23) > I think you can do it with a alias-declaration in an extern "C" block: > > extern "C" { > template > using func_type = T (*)(); > } > > extern "C" voi

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-30 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #24 from Jonathan Wakely 2011-08-30 10:49:27 UTC --- (In reply to comment #23) > I think you can do it with a alias-declaration in an extern "C" block: But that might have only worked when I tested it because Clang++ doesn't overload

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-30 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #23 from Jonathan Wakely 2011-08-30 10:46:51 UTC --- (In reply to comment #22) > Note that some things are painful to do right with extern "C". For instance, > the __stoa helper takes as argument a pointer to a function with a type tha

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-30 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #22 from Marc Glisse 2011-08-30 09:32:24 UTC --- (In reply to comment #21) > I'll try your patch and see what, if anything, can be changed safely in > libstdc++ right away. Thanks :-) Note that some things are painful to do right wit

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-30 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #21 from Jonathan Wakely 2011-08-30 09:12:23 UTC --- Thanks, Marc! We can (and eventually should) fix anything in libstdc++ that incorrectly relies on this bug. Gthreads might be a little harder, but we could probably overload on langu

[Bug c++/2316] g++ fails to overload on language linkage

2011-08-29 Thread marc.glisse at normalesup dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 --- Comment #20 from Marc Glisse 2011-08-30 00:20:07 UTC --- Created attachment 25134 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25134 remember linkage of a function type This is an extremely basic patch, that probably misses many things

[Bug c++/2316] g++ fails to overload on language linkage

2009-11-11 Thread jason at gcc dot gnu dot org
--- Comment #19 from jason at gcc dot gnu dot org 2009-11-12 04:54 --- I was thinking that the ABI didn't distinguish between C and C++ function types, but I was wrong; it does specify a different mangling for extern "C" functions. The problem is that currently G++ only tracks language

[Bug c++/2316] g++ fails to overload on language linkage

2009-06-04 Thread marc dot glisse at normalesup dot org
--- Comment #18 from marc dot glisse at normalesup dot org 2009-06-05 04:22 --- (In reply to comment #17) I just checked, and the sunpro warning is overzealous. It is meant to catch cases where the programmer writes a declaration with one linkage and later provides a definition with som

[Bug c++/2316] g++ fails to overload on language linkage

2009-06-04 Thread paolo dot carlini at oracle dot com
--- Comment #17 from paolo dot carlini at oracle dot com 2009-06-04 14:49 --- Interestingly, the only current compiler I tried which actually accepts this (SunStudio) warns: "2316.C", line 8: Warning: function int(int(*)()) overloads extern "C" int(extern "C" int(*)()) because of diffe

[Bug c++/2316] g++ fails to overload on language linkage

2009-06-04 Thread pinskia at gcc dot gnu dot org
--- Comment #16 from pinskia at gcc dot gnu dot org 2009-06-04 14:36 --- *** Bug 40336 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added -

[Bug c++/2316] g++ fails to overload on language linkage

2006-12-04 Thread marc dot glisse at normalesup dot org
--- Comment #15 from marc dot glisse at normalesup dot org 2006-12-04 15:54 --- *** Bug 30062 has been marked as a duplicate of this bug. *** -- marc dot glisse at normalesup dot org changed: What|Removed |Added ---

[Bug c++/2316] g++ fails to overload on language linkage

2006-10-14 Thread pinskia at gmail dot com
--- Comment #14 from pinskia at gmail dot com 2006-10-15 03:29 --- Subject: Re: g++ fails to overload on language linkage On Sun, 2006-10-15 at 03:24 +, gcc-bugzilla at kayari dot org wrote: > > --- Comment #13 from gcc-bugzilla at kayari dot org 2006-10-15 03:24 > --- >

Re: [Bug c++/2316] g++ fails to overload on language linkage

2006-10-14 Thread Andrew Pinski
On Sun, 2006-10-15 at 03:24 +, gcc-bugzilla at kayari dot org wrote: > > --- Comment #13 from gcc-bugzilla at kayari dot org 2006-10-15 03:24 > --- > If this ever gets fixed (which I hope it does) then maybe it should depend on > -std=c++98 so this continues to work by default, or it

[Bug c++/2316] g++ fails to overload on language linkage

2006-10-14 Thread gcc-bugzilla at kayari dot org
--- Comment #13 from gcc-bugzilla at kayari dot org 2006-10-15 03:24 --- If this ever gets fixed (which I hope it does) then maybe it should depend on -std=c++98 so this continues to work by default, or it will break a lot of code that incorrectly passes extern "C++" functions to e.g. p

[Bug c++/2316] g++ fails to overload on language linkage

2006-10-10 Thread bkoz at gcc dot gnu dot org
--- Comment #12 from bkoz at gcc dot gnu dot org 2006-10-10 20:07 --- adding ABI keyword as implementing this may change mangling for "C" functions. -- bkoz at gcc dot gnu dot org changed: What|Removed |Added --

[Bug c++/2316] g++ fails to overload on language linkage

2006-10-10 Thread pinskia at gcc dot gnu dot org
--- Comment #11 from pinskia at gcc dot gnu dot org 2006-10-10 16:33 --- *** Bug 29411 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added -

[Bug c++/2316] g++ fails to overload on language linkage

2006-09-12 Thread pinskia at gcc dot gnu dot org
--- Comment #10 from pinskia at gcc dot gnu dot org 2006-09-12 16:55 --- *** Bug 29038 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added -

[Bug c++/2316] g++ fails to overload on language linkage

2006-07-07 Thread pinskia at gcc dot gnu dot org
--- Comment #9 from pinskia at gcc dot gnu dot org 2006-07-07 20:52 --- *** Bug 28308 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added ---

[Bug c++/2316] g++ fails to overload on language linkage

2005-09-11 Thread sebor at roguewave dot com
--- Additional Comments From sebor at roguewave dot com 2005-09-11 21:34 --- In reply to comment #6: The vanilla EDG eccp 3.5 compiles the test case w/o an error: $ eccp -v t.cpp && ./a.out; echo $? Edison Design Group C/C++ Front End, version 3.5 (Nov 9 2004 20:00:33) Copyright 1988-2

[Bug c++/2316] g++ fails to overload on language linkage

2005-09-09 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-09-09 14:27 --- Subject: Re: g++ fails to overload on language linkage "rguenth at gcc dot gnu dot org" <[EMAIL PROTECTED]> writes: | EDG aggrees with gcc here. Maybe not a bug. I don't know why I don't like that

[Bug c++/2316] g++ fails to overload on language linkage

2005-09-09 Thread rguenth at gcc dot gnu dot org
--- Additional Comments From rguenth at gcc dot gnu dot org 2005-09-09 12:56 --- EDG aggrees with gcc here. Maybe not a bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316