diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-01-27 03:51:04 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-01-27 03:51:04 +0000 |
| commit | 3edc4d5ec3fdce08e5c46db32f5f793a1cf7a3f4 (patch) | |
| tree | 0564413897d9730ed1a9d8ba7f749214ed4821ca /clang/test/SemaCXX | |
| parent | 86121519cadca11d8865ec713e248a8740657618 (diff) | |
| download | bcm5719-llvm-3edc4d5ec3fdce08e5c46db32f5f793a1cf7a3f4.tar.gz bcm5719-llvm-3edc4d5ec3fdce08e5c46db32f5f793a1cf7a3f4.zip | |
Fix a major oversight in the comparison of standard conversion
sequences, where we would occasionally determine (incorrectly) that
one standard conversion sequence was a proper subset of another when,
in fact, they contained completely incomparable conversions.
This change records the types in each step within a standard
conversion sequence, so that we can check the specific comparison
types to determine when one sequence is a proper subset of the
other. Fixes this testcase (thanks, Anders!), which was distilled from
PR6095 (also thanks to Anders).
llvm-svn: 94660
Diffstat (limited to 'clang/test/SemaCXX')
| -rw-r--r-- | clang/test/SemaCXX/overload-call-copycon.cpp | 3 | ||||
| -rw-r--r-- | clang/test/SemaCXX/overload-call.cpp | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/overload-call-copycon.cpp b/clang/test/SemaCXX/overload-call-copycon.cpp index 472fae26b81..f57484e5069 100644 --- a/clang/test/SemaCXX/overload-call-copycon.cpp +++ b/clang/test/SemaCXX/overload-call-copycon.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only %s -Wnon-pod-varargs +// RUN: %clang_cc1 -fsyntax-only -verify %s -Wnon-pod-varargs class X { }; int& copycon(X x); @@ -37,7 +37,6 @@ void test_copycon3(B b, const B bc) { float& f1 = copycon3(bc); // expected-warning {{cannot pass object of non-POD type}} } - class C : public B { }; float& copycon4(A a); diff --git a/clang/test/SemaCXX/overload-call.cpp b/clang/test/SemaCXX/overload-call.cpp index 12dc5daccb6..e2a4fd8a0d5 100644 --- a/clang/test/SemaCXX/overload-call.cpp +++ b/clang/test/SemaCXX/overload-call.cpp @@ -347,3 +347,15 @@ namespace test3 { foo(*P); // expected-error {{no matching function for call to 'foo'}} } } + +namespace DerivedToBaseVsVoid { + struct A { }; + struct B : A { }; + + float &f(void *); + int &f(const A*); + + void g(B *b) { + int &ir = f(b); + } +} |

