Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/g++.dg/cpp0x/initlist-array7.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/g++.dg/cpp0x/initlist-array7.C Thu Feb 13 11:34:05 2020 +0900 @@ -0,0 +1,21 @@ +// PR c++/69531 - DR 1307, Overload resolution based on size of array init-list. +// { dg-do run { target c++11 } } + +int f(int const(&)[2]) { return 1; } +int f(int const(&)[3]) { return 2; } + +int +main () +{ + if (f({}) != 1) + __builtin_abort (); + + if (f({1}) != 1) + __builtin_abort (); + + if (f({1, 2}) != 1) + __builtin_abort (); + + if (f({1, 2, 3}) != 2) + __builtin_abort (); +}