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-Tag: upstream/12.2.0~33066 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=129c8d7e332a4d051f0e9d6f936b131198a3f7a9;p=platform%2Fupstream%2Fgcc.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 0244231..b249f61 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 0000000..d0dc6d8 --- /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" } +}