From ea3c20b9eb737cfb77eb8708fdc9fb6d0c4ff7a3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 2 Jun 2007 22:47:04 +0000 Subject: [PATCH] When a function decays into its address, ensure the result type keeps any typedef information associated with the input. llvm-svn: 39562 --- clang/Sema/SemaExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp index 2c40ad3281ae..8e852fbd2aff 100644 --- a/clang/Sema/SemaExpr.cpp +++ b/clang/Sema/SemaExpr.cpp @@ -559,7 +559,7 @@ QualType Sema::UsualUnaryConversion(QualType t) { if (t->isPromotableIntegerType()) // C99 6.3.1.1p2 return Context.IntTy; if (t->isFunctionType()) // C99 6.3.2.1p4 - return Context.getPointerType(t.getCanonicalType()); + return Context.getPointerType(t); if (const ArrayType *ary = dyn_cast(t.getCanonicalType())) return Context.getPointerType(ary->getElementType()); // C99 6.3.2.1p3 return t; -- GitLab