I tried changing this test to use { dg-do compile { target c++14 } } and it started to FAIL, because the complex_literals operators are only used for -std=c++14 mode. With -std=gnu++14 we get the GNU extension described at https://gcc.gnu.org/onlinedocs/gcc/Complex.html
* testsuite/26_numerics/complex/literals/types.cc: Add comment. Tested x86_64-linux, committed to trunk.
commit 9565c37c3a3a3624190b38fe92d9f5a2cc9b7a04 Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed Aug 17 16:09:15 2016 +0000 Add comment explaining why -std=c++14 is needed. * testsuite/26_numerics/complex/literals/types.cc: Add comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239543 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/libstdc++-v3/testsuite/26_numerics/complex/literals/types.cc b/libstdc++-v3/testsuite/26_numerics/complex/literals/types.cc index ef48c0d..ad9b863 100644 --- a/libstdc++-v3/testsuite/26_numerics/complex/literals/types.cc +++ b/libstdc++-v3/testsuite/26_numerics/complex/literals/types.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=c++1y" } +// Use -std=c++14 explicitly, because -std=gnu++14 enables GNU extension for +// complex literals, so 1.0if is __complex__ float not std::complex<float>. +// { dg-options "-std=c++14" } // { dg-do compile } // Copyright (C) 2013-2016 Free Software Foundation, Inc.