This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17754] New: [3.4 regression] Static member function not accepted as non-type template argument
- From: "benh at bwsint dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Sep 2004 17:59:27 -0000
- Subject: [Bug c++/17754] New: [3.4 regression] Static member function not accepted as non-type template argument
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
g++ 3.4.1 doesn't accept a static member function as the argument for a non-type
template parameter of the appropriate function type. For example, given:
<code>
template<void (*)()> void tfunc();
struct foo
{
static void bar();
};
void foo::bar()
{
tfunc<bar>();
}
</code>
it says:
<error>
In static member function `static void foo::bar()':
error: `static void foo::bar()' cannot appear in a constant-expression
error: template argument 1 is invalid
error: no matching function for call to `tfunc()'
</error>
g++ 3.3.4 accepts the code.
--
Summary: [3.4 regression] Static member function not accepted as
non-type template argument
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: benh at bwsint dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i486-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17754