diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-21 23:24:10 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-21 23:24:10 +0000 |
commit | 6b7f12c0396e18f51540c4901bb8ccbc35db1151 (patch) | |
tree | 9224134beb04e1b481f52b802c9cd5fb6ba120df /clang/test | |
parent | 14b1d758c621145e26dc9476f0fa242b7c42930b (diff) | |
download | bcm5719-llvm-6b7f12c0396e18f51540c4901bb8ccbc35db1151.tar.gz bcm5719-llvm-6b7f12c0396e18f51540c4901bb8ccbc35db1151.zip |
Switch the initialization of Objective-C message parameters (as occurs
during message sends) over to the new initialization code and away
from the C-only CheckSingleAssignmentConstraints. The enables the use
of C++ types in method parameters and message arguments, as well as
unifying more initialiation code overall.
llvm-svn: 102035
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaObjCXX/message.mm | 15 | ||||
-rw-r--r-- | clang/test/SemaObjCXX/objc-pointer-conv.mm | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/clang/test/SemaObjCXX/message.mm b/clang/test/SemaObjCXX/message.mm index 91b11f146cc..97ee499aff7 100644 --- a/clang/test/SemaObjCXX/message.mm +++ b/clang/test/SemaObjCXX/message.mm @@ -75,3 +75,18 @@ struct identity { return [super method]; } @end + +struct String { + String(const char *); +}; + +struct MutableString : public String { }; + +// C++-specific parameter types +@interface I5 +- method:(const String&)str1 other:(String&)str2; +@end + +void test_I5(I5 *i5, String s) { + [i5 method:"hello" other:s]; +} diff --git a/clang/test/SemaObjCXX/objc-pointer-conv.mm b/clang/test/SemaObjCXX/objc-pointer-conv.mm index 02ed58b0123..2504dcedb84 100644 --- a/clang/test/SemaObjCXX/objc-pointer-conv.mm +++ b/clang/test/SemaObjCXX/objc-pointer-conv.mm @@ -32,7 +32,7 @@ void RandomFunc(CFMDRef theDict, const void *key, const void *value); void Func (I* arg); // expected-note {{candidate function not viable: no known conversion from 'I const *' to 'I *' for 1st argument}} void foo(const I *p, I* sel) { - [sel Meth : p]; // expected-error {{sending 'I const *' to parameter of incompatible type 'I *'}} + [sel Meth : p]; // expected-error {{cannot initialize a parameter of type 'I *' with an lvalue of type 'I const *'}} Func(p); // expected-error {{no matching function for call to 'Func'}} } |