diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-04 15:04:32 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-04 15:04:32 +0000 |
commit | 51fb8b013e7734b795139f49d3b1f77c539be20a (patch) | |
tree | 59e0e47a9831dcf0e21e547927c8ebb7e113bfd1 /test/SemaCXX/overloaded-operator.cpp | |
parent | 73490b890977362d28dd6326843a1ecae413921d (diff) |
Diffstat (limited to 'test/SemaCXX/overloaded-operator.cpp')
-rw-r--r-- | test/SemaCXX/overloaded-operator.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/SemaCXX/overloaded-operator.cpp b/test/SemaCXX/overloaded-operator.cpp index 10b0f5a76804f..0f723ad206b9b 100644 --- a/test/SemaCXX/overloaded-operator.cpp +++ b/test/SemaCXX/overloaded-operator.cpp @@ -70,6 +70,34 @@ void enum_test(Enum1 enum1, Enum2 enum2, E1 e1, E2 e2) { float &f4 = (enum1 == enum2); // expected-error{{non-const lvalue reference to type 'float' cannot be initialized with a temporary of type 'bool'}} } +// PR5244 - Argument-dependent lookup would include the two operators below, +// which would break later assumptions and lead to a crash. +class pr5244_foo +{ + pr5244_foo(int); + pr5244_foo(char); +}; + +bool operator==(const pr5244_foo& s1, const pr5244_foo& s2); +bool operator==(char c, const pr5244_foo& s); + +enum pr5244_bar +{ + pr5244_BAR +}; + +class pr5244_baz +{ + pr5244_bar quux; +}; + +void pr5244_barbaz() +{ + pr5244_baz quuux; + (void)(pr5244_BAR == quuux.quux); +} + + struct PostInc { PostInc operator++(int); |