diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2019-05-29 15:17:55 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2019-05-29 15:17:55 +0000 |
commit | 6b03a1b42352e38fafff67c6d8d685144b8f9a4c (patch) | |
tree | 7dd2b784d1e7cc724c901400f0b45afb362dde95 /libcxx/test/std/numerics/numeric.ops | |
parent | c450874cb847b2c27ecc8776d39db2640627c4d0 (diff) | |
download | bcm5719-llvm-6b03a1b42352e38fafff67c6d8d685144b8f9a4c.tar.gz bcm5719-llvm-6b03a1b42352e38fafff67c6d8d685144b8f9a4c.zip |
Add additional constraints on midpoint(pointer, pointer). Fixes PR#42037.
llvm-svn: 361970
Diffstat (limited to 'libcxx/test/std/numerics/numeric.ops')
-rw-r--r-- | libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.fail.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.fail.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.fail.cpp index 2352ce788be..c7576108af5 100644 --- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.fail.cpp +++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.fail.cpp @@ -18,13 +18,22 @@ #include "test_macros.h" +int func1 () { return 1; } +int func2 () { return 2; } + +struct Incomplete; +Incomplete *ip = nullptr; +void *vp = nullptr; + int main(int, char**) { - (void) std::midpoint(false, true); // expected-error {{no matching function for call to 'midpoint'}} + (void) std::midpoint(false, true); // expected-error {{no matching function for call to 'midpoint'}} // A couple of odd pointer types that should fail - (void) std::midpoint(nullptr, nullptr); // expected-error {{no matching function for call to 'midpoint'}} - (void) std::midpoint((void *)0, (void *)0); // expected-error@numeric:* {{arithmetic on pointers to void}} + (void) std::midpoint(nullptr, nullptr); // expected-error {{no matching function for call to 'midpoint'}} + (void) std::midpoint(func1, func2); // expected-error {{no matching function for call to 'midpoint'}} + (void) std::midpoint(ip, ip); // expected-error {{no matching function for call to 'midpoint'}} + (void) std::midpoint(vp, vp); // expected-error {{no matching function for call to 'midpoint'}} return 0; } |