public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51507] New: [C++0x] Function parameter pack doesn't use in template-argument-list
@ 2011-12-12  7:01 digital-ghost_tsundere at hotmail dot co.jp
  2011-12-22 16:07 ` [Bug c++/51507] " jason at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: digital-ghost_tsundere at hotmail dot co.jp @ 2011-12-12  7:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51507

             Bug #: 51507
           Summary: [C++0x] Function parameter pack doesn't use in
                    template-argument-list
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: digital-ghost_tsundere@hotmail.co.jp


Following code cannot compile with gcc:

  template<typename ...>
  struct foo { typedef void type; };
  template<typename ...Ts>
  auto g(Ts ...ts)->
      typename foo<decltype(ts)...>::type
  {}
  int main() {
      g(42);
  }

Error:

  test1.cpp: In function 'int main()':
  test1.cpp:8:9: error: expansion pattern 'int' contains no argument packs
  test1.cpp:8:9: error: no matching function for call to 'g(int)'
  test1.cpp:8:9: note: candidate is:
  test1.cpp:4:6: note: template<class ... Ts> typename foo<decltype
(ts)...>::type g(Ts ...)

I think decltype(fs()) is a valid template-argument pattern for foo.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-23 22:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-12  7:01 [Bug c++/51507] New: [C++0x] Function parameter pack doesn't use in template-argument-list digital-ghost_tsundere at hotmail dot co.jp
2011-12-22 16:07 ` [Bug c++/51507] " jason at gcc dot gnu.org
2011-12-23 22:09 ` jason at gcc dot gnu.org
2011-12-23 23:03 ` jason at gcc dot gnu.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).