From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23975 invoked by alias); 24 Nov 2007 11:42:09 -0000 Received: (qmail 23962 invoked by uid 48); 24 Nov 2007 11:42:03 -0000 Date: Sat, 24 Nov 2007 11:42:00 -0000 Subject: [Bug c++/34213] New: static member function in anonymous namespace can't be used as template argument X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tim at klingt dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg02306.txt.bz2 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 call(void) { fn(); } namespace { struct bar { static void fn(void) {} }; } int main() { call<&bar::fn>(); } it complains: error: ‘::bar::fn’ is not a valid template argument for type ‘void (*)()’ because function ‘static void::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