From: paolo Date: Sat, 17 May 2014 20:22:30 +0000 (+0000) Subject: 2014-05-17 Paolo Carlini X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0345f05c314708ce008d73014e3415c2d5811a3a;p=thirdparty%2Fgcc.git 2014-05-17 Paolo Carlini PR c++/52875 * g++.dg/cpp0x/decltype58.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210562 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3c7ff36e95fa..d543cb3777a8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-05-17 Paolo Carlini + + PR c++/52875 + * g++.dg/cpp0x/decltype58.C: New. + 2014-05-17 Marc Glisse PR tree-optimization/61140 diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype58.C b/gcc/testsuite/g++.dg/cpp0x/decltype58.C new file mode 100644 index 000000000000..c3918bf8474a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype58.C @@ -0,0 +1,24 @@ +// PR c++/52875 +// { dg-do compile { target c++11 } } + +struct A +{ + friend void swap(A&,A&) {} +}; + +class B +{ + A a; + + template + friend auto swap(T& x, T& y) -> decltype(swap(x.a,y.a)) + { + swap(x.a,y.a); + } +}; + +int main() +{ + B x, y; + swap(x, y); +}