re PR c++/61135 (It seems to be not able to call virtual method of literal object...
authorPaolo Carlini <paolo.carlini@oracle.com>
Sat, 3 Mar 2018 00:28:03 +0000 (00:28 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sat, 3 Mar 2018 00:28:03 +0000 (00:28 +0000)
2018-03-02  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/61135
* g++.dg/cpp0x/lambda/lambda-61135.C: New.

From-SVN: r258165

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

index 0244231ac5218e98a20a7e1752a9ab65cdb028ff..b249f618f6d7eaabbaa042614d11f7e2a6698c90 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-02  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/61135
+       * g++.dg/cpp0x/lambda/lambda-61135.C: New.
+
 2018-03-02  Marek Polacek  <polacek@redhat.com>
 
        PR c++/84578
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-61135.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-61135.C
new file mode 100644 (file)
index 0000000..d0dc6d8
--- /dev/null
@@ -0,0 +1,14 @@
+// { dg-do compile { target c++11 } }
+
+struct Base
+{
+  virtual int b() const{return 1;};
+};
+
+struct Super:Base{};
+
+int main()
+{
+  constexpr Super s;
+  []{s.b();}();  // { dg-error "not captured" }
+}