[cfe-commits] Preliminary patch to support MSVC __declspec(property)

endlessroad1991 at gmail.com endlessroad1991 at gmail.com
Mon Apr 15 20:53:51 PDT 2013


Last problem:



>
> 2. In Sema/SemaExpr.cpp, ActOnCallExpr():
> I admit that I'm not very thorough about this one...
> But here the CheckPlaceholderExpr() call does solve the follwing problem.
> === Code Start ===
> // If compiled with -ggdb, clang will crash and saying something about
> // "unexpected builtin-type" in some CG code.
>
> struct S2 {
> template <class T>
> void f(T t) {}
> };
>
> template <class T>
> struct S
> {
> __declspec(property(get=GetV)) int V;
> int GetV() { return 123; }
> void f() { S2 s2; s2.f(V); }
> };
>
> int main() {
> S<int> s;
> s.f();
> }
> === Code End ===
>
>
> Ah, I think the problem here is that overload resolution and especially
> template argument deduction aren't lowering out placeholder types.  Please
> hoist this loop out of the C++ block (for obscure reasons; just trust me)
> and check:
>   hasPlaceholderType(BuiltinType::PseudoObject)
> instead of checking for a particular expression kind.
>
> And please add this as a test case. :)
>

This change leads to a test failure:
test/SemaObjc/property-user-setter.m, Line 88:
void g(int); // expected-note {{passing argument to parameter here}}
this note is no longer printed.
If it's fine, wen can just remove the expected-note comment, but I don't
know if it's appropriate.

However, patch attached.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130416/dc372ad8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.patch
Type: application/octet-stream
Size: 63941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130416/dc372ad8/attachment.obj>


More information about the cfe-commits mailing list