]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/61135 (It seems to be not able to call virtual method of literal object...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 13 Sep 2017 17:28:37 +0000 (17:28 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 13 Sep 2017 17:28:37 +0000 (17:28 +0000)
2017-09-13  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/61135
* g++.dg/cpp0x/lambda/lambda-ice18.C: New.
* g++.dg/cpp1y/lambda-ice2.C: Likewise.

From-SVN: r252571

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice18.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/lambda-ice2.C [new file with mode: 0644]

index 86d030de2d9f4f68a26d972eabc79d892e9d9680..e739feafd3ad055f6807100499cfa0facc873994 100644 (file)
@@ -1,3 +1,9 @@
+2017-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/61135
+       * g++.dg/cpp0x/lambda/lambda-ice18.C: New.
+       * g++.dg/cpp1y/lambda-ice2.C: Likewise.
+
 2017-09-13  Jackson Woodruff  <jackson.woodruff@arm.com>
 
        * gcc.target/aarch64/simd/vect_str_zero.c: Update testcase.
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice18.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice18.C
new file mode 100644 (file)
index 0000000..83e8ae0
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/61135
+// { dg-do compile { target c++11 } }
+
+struct Base
+{
+  virtual int b() const{return 1;};
+};
+   
+struct Super:Base{};
+int main()
+{
+  constexpr Super s = Super();
+  [&]{s.b();}();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-ice2.C b/gcc/testsuite/g++.dg/cpp1y/lambda-ice2.C
new file mode 100644 (file)
index 0000000..8539de1
--- /dev/null
@@ -0,0 +1,21 @@
+// PR c++/61135
+// { dg-do compile { target c++14 } }
+
+struct A
+{
+  int funcA(){return 0;}
+};
+
+template<class>
+struct B:virtual public A{
+  void funcB(){
+    [a=this->funcA()]{};
+  }
+};
+
+int main()
+{
+  B<A> b;
+  b.funcB();
+  return 0;
+}