From: Paolo Carlini Date: Sat, 3 Mar 2018 00:28:03 +0000 (+0000) Subject: re PR c++/61135 (It seems to be not able to call virtual method of literal object... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=129c8d7e332a4d051f0e9d6f936b131198a3f7a9;p=gcc.git re PR c++/61135 (It seems to be not able to call virtual method of literal object in lambda expression) 2018-03-02 Paolo Carlini PR c++/61135 * g++.dg/cpp0x/lambda/lambda-61135.C: New. From-SVN: r258165 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0244231ac52..b249f618f6d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-03-02 Paolo Carlini + + PR c++/61135 + * g++.dg/cpp0x/lambda/lambda-61135.C: New. + 2018-03-02 Marek Polacek 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 index 00000000000..d0dc6d8bc51 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-61135.C @@ -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" } +}