[cfe-commits] r121720 - in /cfe/trunk: include/clang/AST/TypeLoc.h lib/AST/TypeLoc.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp

John McCall rjmccall at apple.com
Mon Dec 13 15:06:48 PST 2010


On Dec 13, 2010, at 2:40 PM, Chandler Carruth wrote:
> On Mon, Dec 13, 2010 at 2:27 PM, Abramo Bagnara <abramo.bagnara at gmail.com> wrote:
> Skip ParenType on function instantiations.
> 
> While this fixes one case, your patch remains fundamentally broken. There are more cases throughout Sema that reason about a QualType or TypeSourceInfo or TypeLoc and expect getAs<FunctionType> or dyn_cast<FunctionType> to Just Work. They don't any more. Function attributes won't work now for example. Can you audit the codebase looking for these? They should be very easy to craft test cases for.

getAs<>() should be working just fine because (1) the canonical type is untouched and (2) isSugared() and desugar() have been implemented correctly.  Chandler is right that we probably need to check all the explicit isa<>s on TypeLocs.

I am skeptical that we need QualType::IgnoreParens() at all, but TypeLoc::IgnoreParens is reasonable, although I agree with Chandler that this should be an inline function.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101213/2bc621aa/attachment.html>


More information about the cfe-commits mailing list