public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48424] New: C++0x parameter packs expansion problem
@ 2011-04-03 13:42 aiedail92 at gmail dot com
2011-04-03 15:14 ` [Bug c++/48424] " redi at gcc dot gnu.org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: aiedail92 at gmail dot com @ 2011-04-03 13:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48424
Summary: C++0x parameter packs expansion problem
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: aiedail92@gmail.com
The following testcase, which should be valid (at least I think so), fails to
compile:
#include <tuple>
#include <functional>
template<typename... T>
struct test
{
std::tuple<int, T..., long> t; // OK
void(*fptr)(int, T..., long); // Error (1)
std::function<void(int, T..., long)> f; // Error (2)
};
Since in (1) and (2) T... is not a parameter pack declaration, but a parameter
pack expansion, shouldn't the code be valid? And if it's really not valid, is
there a good explanation for this?
luca@laptop-luca:~$ g++ --version
g++ (GCC) 4.7.0 20110330 (experimental)
luca@laptop-luca:~$ g++ -std=c++0x testcase.cc
testcase.cc:8:32: error: parameter packs must be at the end of the parameter
list
testcase.cc:9:39: error: parameter packs must be at the end of the parameter
list
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/48424] C++0x parameter packs expansion problem
2011-04-03 13:42 [Bug c++/48424] New: C++0x parameter packs expansion problem aiedail92 at gmail dot com
@ 2011-04-03 15:14 ` redi at gcc dot gnu.org
2011-04-04 18:16 ` jason at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-03 15:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48424
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-03 15:13:50 UTC ---
It certainly looks reasonable. Jason, should this be accepted?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/48424] C++0x parameter packs expansion problem
2011-04-03 13:42 [Bug c++/48424] New: C++0x parameter packs expansion problem aiedail92 at gmail dot com
2011-04-03 15:14 ` [Bug c++/48424] " redi at gcc dot gnu.org
@ 2011-04-04 18:16 ` jason at gcc dot gnu.org
2011-04-18 21:24 ` redi at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-04-04 18:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48424
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.04.04 18:16:41
Ever Confirmed|0 |1
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-04-04 18:16:41 UTC ---
Yes, that's an obsolete restriction that has been removed from the draft;
8.3.5/13 used to say "A function parameter pack, if present, shall occur at the
end of the parameter-declaration-list." but it doesn't any more.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/48424] C++0x parameter packs expansion problem
2011-04-03 13:42 [Bug c++/48424] New: C++0x parameter packs expansion problem aiedail92 at gmail dot com
2011-04-03 15:14 ` [Bug c++/48424] " redi at gcc dot gnu.org
2011-04-04 18:16 ` jason at gcc dot gnu.org
@ 2011-04-18 21:24 ` redi at gcc dot gnu.org
2011-04-18 22:46 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-18 21:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48424
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-18 21:23:46 UTC ---
Jason, when this bug is fixed will this be allowed too?
template<typename... Args1>
struct S
{
template<typename... Args2>
void f(Args1... args1, Args2&&... args2)
{
}
};
S<int, int> s;
Currently this gives:
var.cc:5:47: error: parameter packs must be at the end of the parameter list
But it seems like it should be ok since sizeof...(Args1) is fixed when calling
S::f and so shouldn't interfere with deducing Args2
(I wanted to do something of this form to make std::mem_fn support varargs
member functions such as R (T::*)(int, ...) where Args1 would be [int] and
Args2 would be the additional arguments passed to _Mem_fn::operator())
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/48424] C++0x parameter packs expansion problem
2011-04-03 13:42 [Bug c++/48424] New: C++0x parameter packs expansion problem aiedail92 at gmail dot com
` (2 preceding siblings ...)
2011-04-18 21:24 ` redi at gcc dot gnu.org
@ 2011-04-18 22:46 ` jason at gcc dot gnu.org
2011-05-26 3:38 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-04-18 22:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48424
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-04-18 22:45:55 UTC ---
Yes, that looks OK too.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/48424] C++0x parameter packs expansion problem
2011-04-03 13:42 [Bug c++/48424] New: C++0x parameter packs expansion problem aiedail92 at gmail dot com
` (3 preceding siblings ...)
2011-04-18 22:46 ` jason at gcc dot gnu.org
@ 2011-05-26 3:38 ` jason at gcc dot gnu.org
2011-05-26 13:25 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-26 3:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48424
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/48424] C++0x parameter packs expansion problem
2011-04-03 13:42 [Bug c++/48424] New: C++0x parameter packs expansion problem aiedail92 at gmail dot com
` (4 preceding siblings ...)
2011-05-26 3:38 ` jason at gcc dot gnu.org
@ 2011-05-26 13:25 ` jason at gcc dot gnu.org
2011-05-26 13:45 ` jason at gcc dot gnu.org
2011-05-26 13:46 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-26 13:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48424
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-26 13:22:54 UTC ---
Author: jason
Date: Thu May 26 13:22:51 2011
New Revision: 174285
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174285
Log:
PR c++/48424
* decl.c (grokparms): Function parameter packs don't need to
go at the end.
* pt.c (type_unification_real): But they aren't deduced otherwise.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/variadic111.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/variadic41.C
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/48424] C++0x parameter packs expansion problem
2011-04-03 13:42 [Bug c++/48424] New: C++0x parameter packs expansion problem aiedail92 at gmail dot com
` (5 preceding siblings ...)
2011-05-26 13:25 ` jason at gcc dot gnu.org
@ 2011-05-26 13:45 ` jason at gcc dot gnu.org
2011-05-26 13:46 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-26 13:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48424
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.6.1
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-26 13:44:06 UTC ---
Fixed for 4.6.1.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/48424] C++0x parameter packs expansion problem
2011-04-03 13:42 [Bug c++/48424] New: C++0x parameter packs expansion problem aiedail92 at gmail dot com
` (6 preceding siblings ...)
2011-05-26 13:45 ` jason at gcc dot gnu.org
@ 2011-05-26 13:46 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-26 13:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48424
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-26 13:44:26 UTC ---
Author: jason
Date: Thu May 26 13:44:20 2011
New Revision: 174287
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174287
Log:
PR c++/48424
* decl.c (grokparms): Function parameter packs don't need to
go at the end.
* pt.c (type_unification_real): But they aren't deduced otherwise.
Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/variadic111.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/decl.c
branches/gcc-4_6-branch/gcc/cp/pt.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/variadic41.C
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-05-26 13:45 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-03 13:42 [Bug c++/48424] New: C++0x parameter packs expansion problem aiedail92 at gmail dot com
2011-04-03 15:14 ` [Bug c++/48424] " redi at gcc dot gnu.org
2011-04-04 18:16 ` jason at gcc dot gnu.org
2011-04-18 21:24 ` redi at gcc dot gnu.org
2011-04-18 22:46 ` jason at gcc dot gnu.org
2011-05-26 3:38 ` jason at gcc dot gnu.org
2011-05-26 13:25 ` jason at gcc dot gnu.org
2011-05-26 13:45 ` jason at gcc dot gnu.org
2011-05-26 13:46 ` 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).