When a function decays into its address, ensure the result type keeps any

typedef information associated with the input.

llvm-svn: 39562
This commit is contained in:
Chris Lattner 2007-06-02 22:47:04 +00:00
parent 2b4e21ac3f
commit ea3c20b9eb
1 changed files with 1 additions and 1 deletions

View File

@ -559,7 +559,7 @@ QualType Sema::UsualUnaryConversion(QualType t) {
if (t->isPromotableIntegerType()) // C99 6.3.1.1p2 if (t->isPromotableIntegerType()) // C99 6.3.1.1p2
return Context.IntTy; return Context.IntTy;
if (t->isFunctionType()) // C99 6.3.2.1p4 if (t->isFunctionType()) // C99 6.3.2.1p4
return Context.getPointerType(t.getCanonicalType()); return Context.getPointerType(t);
if (const ArrayType *ary = dyn_cast<ArrayType>(t.getCanonicalType())) if (const ArrayType *ary = dyn_cast<ArrayType>(t.getCanonicalType()))
return Context.getPointerType(ary->getElementType()); // C99 6.3.2.1p3 return Context.getPointerType(ary->getElementType()); // C99 6.3.2.1p3
return t; return t;