Commit 97e63e12 by Paolo Carlini Committed by Paolo Carlini

re PR c++/61362 (g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile lambda with template)

2017-09-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/61362
	* g++.dg/cpp0x/lambda/lambda-ice19.C: New.
	* g++.dg/cpp0x/lambda/lambda-ice20.C: Likewise.

From-SVN: r252724
parent bce5091a
2017-09-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/61362
* g++.dg/cpp0x/lambda/lambda-ice19.C: New.
* g++.dg/cpp0x/lambda/lambda-ice20.C: Likewise.
2017-09-13 Steve Ellcey <sellcey@cavium.com>
PR tree-optimization/80925
......
// PR c++/61362
// { dg-do compile { target c++11 } }
struct function {
template<class F>
function(F){}
void operator()(...) {}
};
struct Node {
unsigned length;
};
template<typename N>
class C {
public:
unsigned longest = 0;
function f = [this](N node) {
if(node->length > this->longest) this->longest = node->length;
};
};
int main() {
Node n;
n.length = 5;
C<Node*> c;
c.f(&n);
}
// PR c++/61362
// { dg-do compile { target c++11 } }
template <typename>
struct S {
int f{[this](){return 42;}()};
};
int main(){
return S<int>{}.f; // should be 42
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment