public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "flo.goujeon at orange dot fr" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/47475] New: Static member function template of class variadic template can't be called from the inside Date: Wed, 26 Jan 2011 15:14:00 -0000 [thread overview] Message-ID: <bug-47475-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47475 Summary: Static member function template of class variadic template can't be called from the inside Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: flo.goujeon@orange.fr GCC 4.5 and 4.6 can't compile the following piece of code, which seems valid: **************************************** template<typename... Ts> struct test; template<> struct test<> { template<typename> static void f() { } }; template<typename T, typename... Ts> struct test<T, Ts...> { template<typename U> static void f() { test<Ts...>::f<U>(); //compiler error here } }; **************************************** Here is the compiler error message: **************************************** || /usr/local/bin/g++ -c main.cpp -W -Wall -pedantic -std=c++0x || main.cpp: In static member function ‘static void test<T, Ts ...>::f()’: main.cpp|19 col 19| error: expected primary-expression before ‘>’ token main.cpp|19 col 21| error: expected primary-expression before ‘)’ token || make: *** [main.o] Error 1 **************************************** However, GCC doesn't complain with this: **************************************** int main() { test<int, double>::f<int>(); } ****************************************
next reply other threads:[~2011-01-26 14:59 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-01-26 15:14 flo.goujeon at orange dot fr [this message] 2011-01-26 16:48 ` [Bug c++/47475] [C++0x] " redi at gcc dot gnu.org 2011-01-26 17:17 ` redi at gcc dot gnu.org 2011-01-26 17:28 ` flo.goujeon at orange dot fr
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-47475-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).