diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2015-03-05 09:15:58 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-03-05 09:15:58 +0000 |
commit | 512141f41a344cd2b0f317e013e286e412077bf1 (patch) | |
tree | b06efe620ee2433173cd0612a39ef85d97a30a42 /gcc | |
parent | b162e1e749b8c7cb567e5f38bbc461d77c9f8439 (diff) | |
download | gcc-512141f41a344cd2b0f317e013e286e412077bf1.zip gcc-512141f41a344cd2b0f317e013e286e412077bf1.tar.gz gcc-512141f41a344cd2b0f317e013e286e412077bf1.tar.bz2 |
re PR c++/64665 (Overload resolution not working with std::initializer_list<std::string> and bool)
2015-03-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/64665
* g++.dg/cpp0x/initlist92.C: New.
From-SVN: r221207
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/initlist92.C | 56 |
2 files changed, 61 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 77da7e9..2dff949 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-05 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/64665 + * g++.dg/cpp0x/initlist92.C: New. + 2015-03-05 Richard Biener <rguenther@suse.de> PR tree-optimization/65310 diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist92.C b/gcc/testsuite/g++.dg/cpp0x/initlist92.C new file mode 100644 index 0000000..527533c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist92.C @@ -0,0 +1,56 @@ +// PR c++/64665, DR 1467 +// { dg-do run { target c++11 } } + +#include <string> +#include <cassert> + +bool Test1(const bool arg) +{ + return true; +} +bool Test1(const std::string arg) +{ + return false; +} + +bool Test2(const int arg) +{ + return false; +} +bool Test2(const std::initializer_list<int> arg) +{ + return true; +} + +struct S +{ + S(int _a) : a(_a){} + int getA() const { return a; } +private: + int a; +}; +bool Test3(const int arg) +{ + return true; +} +bool Test3(const S arg) +{ + return false; +} + +bool Test4(const bool arg) +{ + return false; +} +bool Test4(const std::initializer_list<std::string> arg) +{ + return true; +} + +int main () +{ + assert ( Test1({"false"}) ); + assert ( Test2({123}) ); + assert ( Test3({456}) ); + assert ( Test4({"false"}) ); +} |