diff options
Diffstat (limited to 'test/CXX/over/over.match/over.match.funcs/over.match.oper/p3.cpp')
-rw-r--r-- | test/CXX/over/over.match/over.match.funcs/over.match.oper/p3.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/test/CXX/over/over.match/over.match.funcs/over.match.oper/p3.cpp b/test/CXX/over/over.match/over.match.funcs/over.match.oper/p3.cpp index 35f8808fff88c..d88d5beb4e99e 100644 --- a/test/CXX/over/over.match/over.match.funcs/over.match.oper/p3.cpp +++ b/test/CXX/over/over.match/over.match.funcs/over.match.oper/p3.cpp @@ -1,5 +1,27 @@ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s -// expected-no-diagnostics + +namespace bullet2 { + +// For non-member candidates, if no operand has a class type, only those +// non-member functions that have a matching enumeration parameter are +// candidates. + +struct B { template<typename T> B(T); }; +int operator~(B); +template<typename T> int operator%(B, T); +enum class E { e }; + +template<typename T> int f(T t) { return ~t; } // expected-error {{invalid argument type}} +template<typename T, typename U> int f(T t, U u) { return t % u; } // expected-error {{invalid operands to}} + +int b1 = ~E::e; // expected-error {{invalid argument type}} +int b2 = f(E::e); // expected-note {{in instantiation of}} +int b3 = f(0, E::e); +int b4 = f(E::e, 0); // expected-note {{in instantiation of}} + +} + +namespace bullet3 { // This is specifically testing the bullet: // "do not have the same parameter-type-list as any non-template @@ -26,4 +48,6 @@ extern bool test2; extern decltype(a <= a) test2; extern A test3; -extern decltype(a <= b) test3;
\ No newline at end of file +extern decltype(a <= b) test3; + +} |