summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/conditional-expr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-17 22:01:05 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-17 22:01:05 +0000
commit5ab116553171e67015f63178a3927de22400e3da (patch)
tree783c4344096e148c8bcfb1303c6b1987ccb48c44 /clang/test/SemaCXX/conditional-expr.cpp
parent8345a70c671dbd5d7dcfbd1e0e1f68fc9ed0e0c6 (diff)
downloadbcm5719-llvm-5ab116553171e67015f63178a3927de22400e3da.tar.gz
bcm5719-llvm-5ab116553171e67015f63178a3927de22400e3da.zip
Improve our handling of user-defined conversions as part of overload
resolution. There are two sources of problems involving user-defined conversions that this change eliminates, along with providing simpler interfaces for checking implicit conversions: - It eliminates a case of infinite recursion found in Boost. - It eliminates the search for the constructor needed to copy a temporary generated by an implicit conversion from overload resolution. Overload resolution assumes that, if it gets a value of the parameter's class type (or a derived class thereof), there is a way to copy if... even if there isn't. We now model this properly. llvm-svn: 101680
Diffstat (limited to 'clang/test/SemaCXX/conditional-expr.cpp')
-rw-r--r--clang/test/SemaCXX/conditional-expr.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/conditional-expr.cpp b/clang/test/SemaCXX/conditional-expr.cpp
index cb78a2e65f2..aa413232391 100644
--- a/clang/test/SemaCXX/conditional-expr.cpp
+++ b/clang/test/SemaCXX/conditional-expr.cpp
@@ -224,7 +224,7 @@ namespace PR6757 {
struct Foo3 {
Foo3();
- Foo3(Foo3&);
+ Foo3(Foo3&); // expected-note{{would lose const qualifier}}
};
struct Bar {
@@ -236,7 +236,6 @@ namespace PR6757 {
void f() {
(void)(true ? Bar() : Foo1()); // okay
(void)(true ? Bar() : Foo2()); // okay
- // FIXME: Diagnostic below could be improved
- (void)(true ? Bar() : Foo3()); // expected-error{{incompatible operand types ('PR6757::Bar' and 'PR6757::Foo3')}}
+ (void)(true ? Bar() : Foo3()); // expected-error{{no viable constructor copying temporary}}
}
}
OpenPOWER on IntegriCloud