[cfe-dev] Detecting implicit constructor calls
thakis at chromium.org
Tue Nov 2 00:45:25 CDT 2010
I'm trying to write a rewriter that turns implicit constructor (`A a =
4; f(4);`) calls into explicit constructor calls (`A a(4); f(A(4));`).
To find out if a constructor call is implicit, I check if the
CXXConstructExpr is wrapped in a ImplicitCastExpr. This works well,
except if the implicit conversion happens in a function parameter. In
that case, clang doesn't create an ImplicitCastExpr.
Is this intentional? If not, the attached patch fixes this. It doesn't
regress any tests, and it makes clang's ASTs more consistent.
If this is in fact intentional, what's a good way to check if a
constructor call is implicit?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1263 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/cfe-dev/attachments/20101102/6630db22/attachment.obj
More information about the cfe-dev