public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34213] static member function in anonymous namespace can't be used as template argument
2007-11-24 11:42 [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument tim at klingt dot org
@ 2007-11-24 11:42 ` tim at klingt dot org
2007-11-25 3:06 ` [Bug c++/34213] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: tim at klingt dot org @ 2007-11-24 11:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from tim at klingt dot org 2007-11-24 11:42 -------
Created an attachment (id=14629)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14629&action=view)
program to illustrate the issue
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34213
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument
@ 2007-11-24 11:42 tim at klingt dot org
2007-11-24 11:42 ` [Bug c++/34213] " tim at klingt dot org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: tim at klingt dot org @ 2007-11-24 11:42 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]
trying to use member functions of classes in the anonymous namespace as
template argument doesn't work.
the following code illustrates this issue:
template <void (*fn)(void)>
void call(void)
{
fn();
}
namespace
{
struct bar
{
static void fn(void) {}
};
}
int main()
{
call<&bar::fn>();
}
it complains:
error: â<unnamed>::bar::fnâ is not a valid template argument for type
âvoid (*)()â because function âstatic void<unnamed>::bar::fn()â has not
external linkage
gcc -v:
tim@laptop:~$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
--enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr
--enable-targets=all --enable-checking=release --build=i486-linux-gnu
--host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.2.3 20071014 (prerelease) (Debian 4.2.2-3)
would be great to have this fixed ...
--
Summary: static member function in anonymous namespace can't be
used as template argument
Product: gcc
Version: 4.2.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tim at klingt dot org
GCC build triplet: i486-linux-gnu
GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34213
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/34213] [4.2/4.3 Regression] static member function in anonymous namespace can't be used as template argument
2007-11-24 11:42 [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument tim at klingt dot org
2007-11-24 11:42 ` [Bug c++/34213] " tim at klingt dot org
@ 2007-11-25 3:06 ` pinskia at gcc dot gnu dot org
2007-11-26 12:45 ` jakub at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-11-25 3:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-11-25 03:05 -------
Confirmed, another regression due to anonymous namespace changes.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
Severity|normal |major
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC build triplet|i486-linux-gnu |
GCC host triplet|i486-linux-gnu |
GCC target triplet|i486-linux-gnu |
Keywords| |rejects-valid
Known to fail| |4.2.0 4.3.0
Known to work| |4.1.0
Last reconfirmed|0000-00-00 00:00:00 |2007-11-25 03:05:54
date| |
Summary|static member function in |[4.2/4.3 Regression] static
|anonymous namespace can't be|member function in anonymous
|used as template argument |namespace can't be used as
| |template argument
Target Milestone|--- |4.2.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34213
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/34213] [4.2/4.3 Regression] static member function in anonymous namespace can't be used as template argument
2007-11-24 11:42 [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument tim at klingt dot org
2007-11-24 11:42 ` [Bug c++/34213] " tim at klingt dot org
2007-11-25 3:06 ` [Bug c++/34213] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-11-26 12:45 ` jakub at gcc dot gnu dot org
2007-11-27 7:12 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-26 12:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jakub at gcc dot gnu dot org 2007-11-26 12:45 -------
Testing a patch.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2007-11-25 03:05:54 |2007-11-26 12:45:41
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34213
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/34213] [4.2/4.3 Regression] static member function in anonymous namespace can't be used as template argument
2007-11-24 11:42 [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument tim at klingt dot org
` (2 preceding siblings ...)
2007-11-26 12:45 ` jakub at gcc dot gnu dot org
@ 2007-11-27 7:12 ` jakub at gcc dot gnu dot org
2007-11-27 7:13 ` [Bug c++/34213] [4.2 " jakub at gcc dot gnu dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-27 7:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2007-11-27 07:12 -------
Subject: Bug 34213
Author: jakub
Date: Tue Nov 27 07:12:10 2007
New Revision: 130463
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130463
Log:
PR c++/34213
* tree.c (decl_linkage): Static data members and static member
functions in anonymous ns classes are lk_external.
* g++.dg/ext/visibility/anon8.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/ext/visibility/anon8.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/tree.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34213
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/34213] [4.2 Regression] static member function in anonymous namespace can't be used as template argument
2007-11-24 11:42 [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument tim at klingt dot org
` (3 preceding siblings ...)
2007-11-27 7:12 ` jakub at gcc dot gnu dot org
@ 2007-11-27 7:13 ` jakub at gcc dot gnu dot org
2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-27 7:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jakub at gcc dot gnu dot org 2007-11-27 07:13 -------
Fixed on the trunk.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|4.2.0 4.3.0 |4.2.0
Known to work|4.1.0 |4.1.0 4.3.0
Summary|[4.2/4.3 Regression] static |[4.2 Regression] static
|member function in anonymous|member function in anonymous
|namespace can't be used as |namespace can't be used as
|template argument |template argument
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34213
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/34213] [4.2 Regression] static member function in anonymous namespace can't be used as template argument
2007-11-24 11:42 [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument tim at klingt dot org
` (4 preceding siblings ...)
2007-11-27 7:13 ` [Bug c++/34213] [4.2 " jakub at gcc dot gnu dot org
@ 2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
2008-05-19 20:33 ` jsm28 at gcc dot gnu dot org
2009-03-31 1:36 ` jsm28 at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-02-01 17:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jsm28 at gcc dot gnu dot org 2008-02-01 16:55 -------
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.2.3 |4.2.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34213
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/34213] [4.2 Regression] static member function in anonymous namespace can't be used as template argument
2007-11-24 11:42 [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument tim at klingt dot org
` (5 preceding siblings ...)
2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
@ 2008-05-19 20:33 ` jsm28 at gcc dot gnu dot org
2009-03-31 1:36 ` jsm28 at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-05-19 20:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jsm28 at gcc dot gnu dot org 2008-05-19 20:23 -------
4.2.4 is being released, changing milestones to 4.2.5.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.2.4 |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34213
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/34213] [4.2 Regression] static member function in anonymous namespace can't be used as template argument
2007-11-24 11:42 [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument tim at klingt dot org
` (6 preceding siblings ...)
2008-05-19 20:33 ` jsm28 at gcc dot gnu dot org
@ 2009-03-31 1:36 ` jsm28 at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 1:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jsm28 at gcc dot gnu dot org 2009-03-31 01:35 -------
Closing 4.2 branch, fixed in 4.3.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to fail|4.2.0 |4.2.0 4.2.5
Resolution| |FIXED
Target Milestone|4.2.5 |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34213
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-03-31 1:36 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-24 11:42 [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument tim at klingt dot org
2007-11-24 11:42 ` [Bug c++/34213] " tim at klingt dot org
2007-11-25 3:06 ` [Bug c++/34213] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2007-11-26 12:45 ` jakub at gcc dot gnu dot org
2007-11-27 7:12 ` jakub at gcc dot gnu dot org
2007-11-27 7:13 ` [Bug c++/34213] [4.2 " jakub at gcc dot gnu dot org
2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
2008-05-19 20:33 ` jsm28 at gcc dot gnu dot org
2009-03-31 1:36 ` jsm28 at gcc dot gnu dot 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).