diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-05-17 01:58:45 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-05-17 01:58:45 +0000 |
commit | 44d9eceb47dd8f47e4cefd99e5197ab2e361d9fc (patch) | |
tree | fdb75d6abf2690e60498526ce2a1343dfb2346cc /test/SemaCXX/overloaded-operator.cpp | |
parent | 22062cfca2d97d2d90c1c8ecc962aa31069cff7b (diff) | |
download | clang-44d9eceb47dd8f47e4cefd99e5197ab2e361d9fc.tar.gz |
Correct incoherent function versus function template partial ordering for conversion operators (the comparison could claim that two conversion operators are both better than each other). Actually implement DR495, rather than passing its test by chance because the declarations happened to be in the "lucky" order.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209054 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/overloaded-operator.cpp')
-rw-r--r-- | test/SemaCXX/overloaded-operator.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaCXX/overloaded-operator.cpp b/test/SemaCXX/overloaded-operator.cpp index cd2b2d3e7a..feb7c716ff 100644 --- a/test/SemaCXX/overloaded-operator.cpp +++ b/test/SemaCXX/overloaded-operator.cpp @@ -507,3 +507,15 @@ namespace PR14995 { // expected-note@-12 {{candidate template ignored: substitution failure}} } // namespace PR14995 +namespace ConversionVersusTemplateOrdering { + struct A { + operator short() = delete; + template <typename T> operator T(); + } a; + struct B { + template <typename T> operator T(); + operator short() = delete; + } b; + int x = a; + int y = b; +} |