From f51cd72afc933c21d2aa09aa51ddda0729ced4f5 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 20 Mar 2015 17:06:18 +0000 Subject: [PATCH] re PR c++/48453 ([C++0x] [DR 1287] Invalid reference initialization via explicit conversion) 2015-03-20 Paolo Carlini PR c++/48453 * g++.dg/cpp0x/pr48453.C: New. From-SVN: r221537 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/pr48453.C | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr48453.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c489b28c3e4..585c9123f64 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-20 Paolo Carlini + + PR c++/48453 + * g++.dg/cpp0x/pr48453.C: New. + 2015-03-20 Marek Polacek PR c++/65072 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr48453.C b/gcc/testsuite/g++.dg/cpp0x/pr48453.C new file mode 100644 index 00000000000..b0c3da51d6b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr48453.C @@ -0,0 +1,22 @@ +// PR c++/48453, DR 1287 +// { dg-do compile { target c++11 } } + +template +T&& create(); + +template +void test() { + T t(create()); + (void) t; +} + +template +struct To { + explicit operator T(); +}; + +int main() +{ + test>(); + test>(); +} -- 2.30.2