[PATCH] Fixing source range for functional casts and unresolved ctor calls.
Eli Friedman
eli.friedman at gmail.com
Fri Jul 5 11:54:31 PDT 2013
On Fri, Jul 5, 2013 at 12:45 AM, Enea Zaffanella <zaffanella at cs.unipr.it>wrote:
> Please find attached a patch (including testcase) for fixing the
> computation of source ranges for a couple of AST nodes.
>
> Prior to C++11, CXXFunctionalCastExpr and CXXUnresolvedConstructExpr nodes
> were assuming a valid RParenLoc; after C++11, the parentheses are no longer
> mandatory, as in the following examples:
>
> int foo() { return int{}; }
>
> typedef std::initializer_list<int> IL;
> template<class U> IL foo(U x) { return IL{x}; }
>
> OK to commit?
>
>
Do you actually need a definition of initializer_list for this test? IIRC,
you can get an CXXUnresolvedConstructExpr with any dependent type. I like
using unit-tests to check source ranges rather than checking the output of
-ast-dump.
Otherwise, LGTM.
-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130705/bc63eefd/attachment.html>
More information about the cfe-commits
mailing list