public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49554] New: [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object"
@ 2011-06-27 23:26 redi at gcc dot gnu.org
2011-06-27 23:27 ` [Bug c++/49554] " redi at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-06-27 23:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49554
Summary: [4.7 Regression] [C++0x] lambda capture causes "cannot
call member function ... without object"
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: redi@gcc.gnu.org
CC: jason@gcc.gnu.org
template<typename T>
struct base
{
struct iterator { };
iterator begin();
};
template<typename T>
class flist : public base<T>
{
typedef base<T> Base;
typedef typename Base::iterator Base_iterator;
public:
void
resize()
{
Base_iterator b = Base::begin();
[b](int i) { return i; };
}
};
void test01()
{
flist<int> fl;
fl.resize();
}
objexpr.ii: In lambda function:
objexpr.ii:22:6: required from ‘struct flist<T>::resize() [with T =
int]::<lambda(int)>’
objexpr.ii:22:5: required from ‘void flist<T>::resize() [with T = int]’
objexpr.ii:29:13: required from here
objexpr.ii:20:19: error: cannot call member function ‘base<T>::iterator
base<T>::begin() [with T = int]’ without object
If 'b' is not captured there's no error
This breaks <debug/forward_list> in libstdc++
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/49554] [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object"
2011-06-27 23:26 [Bug c++/49554] New: [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object" redi at gcc dot gnu.org
@ 2011-06-27 23:27 ` redi at gcc dot gnu.org
2011-06-27 23:44 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-06-27 23:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49554
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-27 23:26:44 UTC ---
also, if 'b' is initialized like this it works:
Base_iterator b = this->begin();
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/49554] [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object"
2011-06-27 23:26 [Bug c++/49554] New: [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object" redi at gcc dot gnu.org
2011-06-27 23:27 ` [Bug c++/49554] " redi at gcc dot gnu.org
@ 2011-06-27 23:44 ` redi at gcc dot gnu.org
2011-06-29 15:57 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-06-27 23:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49554
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-27 23:44:05 UTC ---
No error for this version:
Base_iterator b;
b = Base::begin();
[b](int i) { return i; };
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/49554] [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object"
2011-06-27 23:26 [Bug c++/49554] New: [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object" redi at gcc dot gnu.org
2011-06-27 23:27 ` [Bug c++/49554] " redi at gcc dot gnu.org
2011-06-27 23:44 ` redi at gcc dot gnu.org
@ 2011-06-29 15:57 ` jason at gcc dot gnu.org
2011-06-29 17:15 ` jason at gcc dot gnu.org
2011-06-29 17:27 ` jason at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-29 15:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49554
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011.06.29 15:56:40
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/49554] [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object"
2011-06-27 23:26 [Bug c++/49554] New: [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object" redi at gcc dot gnu.org
` (2 preceding siblings ...)
2011-06-29 15:57 ` jason at gcc dot gnu.org
@ 2011-06-29 17:15 ` jason at gcc dot gnu.org
2011-06-29 17:27 ` jason at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-29 17:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49554
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-29 17:15:11 UTC ---
Author: jason
Date: Wed Jun 29 17:15:06 2011
New Revision: 175657
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175657
Log:
PR c++/49554
* semantics.c (lambda_proxy_type): New.
(build_capture_proxy): Use it.
* cp-tree.h (DECLTYPE_FOR_LAMBDA_PROXY): New.
* pt.c (tsubst) [DECLTYPE_TYPE]: Use them.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/pt.c
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/49554] [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object"
2011-06-27 23:26 [Bug c++/49554] New: [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object" redi at gcc dot gnu.org
` (3 preceding siblings ...)
2011-06-29 17:15 ` jason at gcc dot gnu.org
@ 2011-06-29 17:27 ` jason at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-29 17:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49554
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.7.0
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-29 17:26:50 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-06-29 17:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-27 23:26 [Bug c++/49554] New: [4.7 Regression] [C++0x] lambda capture causes "cannot call member function ... without object" redi at gcc dot gnu.org
2011-06-27 23:27 ` [Bug c++/49554] " redi at gcc dot gnu.org
2011-06-27 23:44 ` redi at gcc dot gnu.org
2011-06-29 15:57 ` jason at gcc dot gnu.org
2011-06-29 17:15 ` jason at gcc dot gnu.org
2011-06-29 17:27 ` 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).