From: paolo Date: Tue, 15 Dec 2015 10:18:13 +0000 (+0000) Subject: 2015-12-15 Paolo Carlini X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db6287e49846aa6647b87c4ef3a2d16d4e1a3124;p=thirdparty%2Fgcc.git 2015-12-15 Paolo Carlini PR c++/63506 * g++.dg/cpp0x/pr63506-1.C: New. * g++.dg/cpp0x/pr63506-2.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231646 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 790d9c14df92..4d749f1d1f26 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-12-15 Paolo Carlini + + PR c++/63506 + * g++.dg/cpp0x/pr63506-1.C: New. + * g++.dg/cpp0x/pr63506-2.C: Likewise. + 2015-12-15 Olivier Hainque * gcc.target/visium/block_move.c: Skip for -mcpu=gr5. diff --git a/gcc/testsuite/g++.dg/cpp0x/pr63506-1.C b/gcc/testsuite/g++.dg/cpp0x/pr63506-1.C new file mode 100644 index 000000000000..dbdcdfb46c2d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr63506-1.C @@ -0,0 +1,24 @@ +// { dg-do compile { target c++11 } } + +struct proxy {}; + +struct iterator +{ + proxy operator*() { return proxy(); } +}; + +//#define DEACTIVATE + +#ifndef DEACTIVATE +template +#endif +void foo(iterator it) +{ + auto&& x = *it; +} + +int main() +{ + iterator it; + foo(it); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/pr63506-2.C b/gcc/testsuite/g++.dg/cpp0x/pr63506-2.C new file mode 100644 index 000000000000..b6b74e5359cf --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr63506-2.C @@ -0,0 +1,27 @@ +// { dg-do compile { target c++11 } } + +struct proxy {}; + +struct iterator +{ + proxy operator*() { return proxy(); } + + proxy operator[](int i) { return proxy(); } +}; + +//#define DEACTIVATE + +#ifndef DEACTIVATE +template +#endif +void foo(iterator it) +{ + auto&& x = *it; + auto&& y = it[1]; +} + +int main() +{ + iterator it; + foo(it); +}