diff options
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index f57ad2df9c7..1cd23522e8f 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -932,18 +932,8 @@ void Sema::DefaultFunctionArrayConversion(Expr *&E) { } if (Ty->isFunctionType()) ImpCastExprToType(E, Context.getPointerType(Ty)); - else if (const ArrayType *ArrayTy = Ty->getAsArrayType()) { - // Make sure we don't lose qualifiers when dealing with typedefs. Example: - // typedef int arr[10]; - // void test2() { - // const arr b; - // b[4] = 1; - // } - QualType ELT = ArrayTy->getElementType(); - // FIXME: Handle ASQualType - ELT = ELT.getQualifiedType(Ty.getCVRQualifiers()|ELT.getCVRQualifiers()); - ImpCastExprToType(E, Context.getPointerType(ELT)); - } + else if (Ty->isArrayType()) + ImpCastExprToType(E, Context.getArrayDecayedType(Ty)); } /// UsualUnaryConversions - Performs various conversions that are common to most |

