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
+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
--- /dev/null
+// 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);
+}
--- /dev/null
+// 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
+}