On Thu, Nov 8, 2012 at 1:50 PM, Abramo Bagnara
<[email protected]> wrote:
> Il 07/11/2012 01:12, David Blaikie ha scritto:
>> Author: dblaikie
>> Date: Tue Nov  6 18:12:38 2012
>> New Revision: 167507
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=167507&view=rev
>> Log:
>> PR13552: Fix the end location of a CXXNewExpr.
>>
>> Spent longer than reasonable looking for a nice way to test this & decided to
>> give up for now. Open to suggestions/requests. Richard Smith suggested adding
>> something to ASTMatchers but it wasn't readily apparent how to test this with
>> that.
>
> After this commit we have a regression: the range for "new MyClass()"
> now does not include the final parentheses.

Right you are.

>
>>
>> -SourceLocation CXXNewExpr::getEndLoc() const {
>> -  switch (getInitializationStyle()) {
>> -  case NoInit:
>> -    return AllocatedTypeInfo->getTypeLoc().getEndLoc();
>> -  case CallInit:
>> -    return DirectInitRange.getEnd();
>> -  case ListInit:
>> -    return getInitializer()->getSourceRange().getEnd();
>> -  }
>> -  llvm_unreachable("bogus initialization style");
>> -}
>
> I guess that the problem is due to removal of the code above without a
> proper replacement.

Indeed. Fixed in r167597.

Thanks,
- David
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to