diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2018-05-28 19:20:21 +0000 | 
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2018-05-28 19:20:21 +0000 | 
| commit | c58f9b787f209e2296f482cf4de77ff3dfa70f81 (patch) | |
| tree | d320193dfd20c7b7e9cca9e52a3f8658b58ee4c9 /libcxx/test/std/utilities/optional | |
| parent | eacb1020aabac23b4a833f4c9fcde289937a7ba7 (diff) | |
| download | bcm5719-llvm-c58f9b787f209e2296f482cf4de77ff3dfa70f81.tar.gz bcm5719-llvm-c58f9b787f209e2296f482cf4de77ff3dfa70f81.zip | |
Fix up the final bits of breakage due to clang v5 generating bad implicit template deduction guides - specifically for copy-ctors
llvm-svn: 333381
Diffstat (limited to 'libcxx/test/std/utilities/optional')
| -rw-r--r-- | libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp | 10 | ||||
| -rw-r--r-- | libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp | 13 | 
2 files changed, 14 insertions, 9 deletions
| diff --git a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp index 5bbb77d46b2..b76b730d274 100644 --- a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp +++ b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp @@ -9,7 +9,10 @@  // <optional>  // UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: clang-5  // UNSUPPORTED: libcpp-no-deduction-guides +// Clang 5 will generate bad implicit deduction guides +//  Specifically, for the copy constructor.  // template<class T> @@ -28,7 +31,12 @@ int main()  //  Test the implicit deduction guides      {  //  optional() -    std::optional opt;   // expected-error {{declaration of variable 'opt' with deduced type 'std::optional' requires an initializer}} +    std::optional opt;   // expected-error-re {{{{declaration of variable 'opt' with deduced type 'std::optional' requires an initializer|no viable constructor or deduction guide for deduction of template arguments of 'optional'}}}} +//  clang-6 gives a bogus error here: +//      declaration of variable 'opt' with deduced type 'std::optional' requires an initializer +//  clang-7 (and later) give a better message: +//      no viable constructor or deduction guide for deduction of template arguments of 'optional' +//  So we check for one or the other.      }      { diff --git a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp index 807055eed44..0a5f45668cf 100644 --- a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp @@ -9,7 +9,10 @@  // <optional>  // UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: clang-5  // UNSUPPORTED: libcpp-no-deduction-guides +// Clang 5 will generate bad implicit deduction guides +//  Specifically, for the copy constructor.  // template<class T> @@ -40,18 +43,12 @@ int main()      }  //  Test the implicit deduction guides -      { -//  optional(const optional &); -      // FIXME clang and GCC disagree about this! -      // clang thinks opt is optional<optional<char>>, GCC thinks it's optional<char>. -#if 0 +//  optional(optional);      std::optional<char> source('A');      std::optional opt(source); -    static_assert(std::is_same_v<decltype(opt), std::optional<std::optional<char>>>, ""); +    static_assert(std::is_same_v<decltype(opt), std::optional<char>>, "");      assert(static_cast<bool>(opt) == static_cast<bool>(source));      assert(*opt == *source); -#endif      } -  } | 

