[cfe-commits] r167507 - in /cfe/trunk: include/clang/AST/ExprCXX.h include/clang/Sema/Sema.h lib/AST/ExprCXX.cpp lib/Sema/SemaExprCXX.cpp lib/Serialization/ASTReaderStmt.cpp lib/Serialization/ASTWriterStmt.cpp

Abramo Bagnara abramo.bagnara at bugseng.com
Thu Nov 8 13:50:41 PST 2012


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.

>  
> -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.


-- 
Abramo Bagnara

BUGSENG srl - http://bugseng.com
mailto:abramo.bagnara at bugseng.com



More information about the cfe-commits mailing list