[cfe-commits] r46575 - in /cfe/trunk: CodeGen/CodeGenTypes.cpp test/CodeGen/opaque-pointer.c

Eli Friedman eli.friedman at gmail.com
Wed Jan 30 17:44:50 PST 2008


On Jan 30, 2008 1:21 PM, Lauro Ramos Venancio <lauro.venancio at gmail.com> wrote:
> +      isOpaqueTypeDefinition(cast<PointerType>(*T).getPointeeType(),

That's no good; isPointerType() doesn't guarantee that the type is
pointer; for example, this crashes on typedefs.  The preferred style
is something like "if (const PointerType* PTy = T->getAsPointerType())
/* do something with PTy*/".

-Eli



More information about the cfe-commits mailing list