diff options
| author | Eric Fiselier <eric@efcs.ca> | 2016-07-20 06:36:11 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2016-07-20 06:36:11 +0000 |
| commit | 85acffa676147ffd982a0fde77795b043ecee2e6 (patch) | |
| tree | 4686f618aafed72f85c9def32395241aface9332 /libcxx/test | |
| parent | d5b53598026c315234c4b81909d5d88d42fc01d6 (diff) | |
| download | bcm5719-llvm-85acffa676147ffd982a0fde77795b043ecee2e6.tar.gz bcm5719-llvm-85acffa676147ffd982a0fde77795b043ecee2e6.zip | |
Unbreak is_constructible tests for Clang <= 3.7.
There is a bug in Clang's __is_constructible builtin that causes it
to return true for function types; ex [T = void()].
llvm-svn: 276092
Diffstat (limited to 'libcxx/test')
| -rw-r--r-- | libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp | 12 | ||||
| -rw-r--r-- | libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp | 14 |
2 files changed, 25 insertions, 1 deletions
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp index 8c6a965ad75..6f3474cfc24 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp @@ -151,9 +151,21 @@ int main() test_is_constructible<PrivateDtor&, PrivateDtor&>(); test_is_not_constructible<PrivateDtor, int>(); + test_is_not_constructible<void() const, void() const>(); + test_is_not_constructible<void() const, void*>(); + +// TODO: Remove this workaround once Clang <= 3.7 are no longer used regularly. +// In those compiler versions the __is_constructible builtin gives the wrong +// results for abominable function types. +#if defined(__clang__) && __clang_major__ == 3 && __clang_minor__ < 8 +#define WORKAROUND_CLANG_BUG +#endif +#if !defined(WORKAROUND_CLANG_BUG) + test_is_not_constructible<void()>(); test_is_not_constructible<void() const> (); test_is_not_constructible<void() volatile> (); test_is_not_constructible<void() &> (); test_is_not_constructible<void() &&> (); #endif +#endif } diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp index 6ed84d60ebd..52b45cd0619 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp @@ -107,7 +107,19 @@ int main() #if TEST_STD_VER >= 11 test_is_not_default_constructible<B>(); test_is_not_default_constructible<int&&>(); + +// TODO: Remove this workaround once Clang <= 3.7 are no longer used regularly. +// In those compiler versions the __is_constructible builtin gives the wrong +// results for abominable function types. +#if defined(__clang__) && __clang_major__ == 3 && __clang_minor__ < 8 +#define WORKAROUND_CLANG_BUG +#endif +#if !defined(WORKAROUND_CLANG_BUG) test_is_not_default_constructible<void()>(); - test_is_not_default_constructible<void() const>(); + test_is_not_default_constructible<void() const> (); + test_is_not_default_constructible<void() volatile> (); + test_is_not_default_constructible<void() &> (); + test_is_not_default_constructible<void() &&> (); +#endif #endif } |

