Index: lib/Sema/SemaChecking.cpp =================================================================== --- lib/Sema/SemaChecking.cpp +++ lib/Sema/SemaChecking.cpp @@ -4707,7 +4707,7 @@ /// \brief If E is a sizeof expression, returns its argument type. static QualType getSizeOfArgType(const Expr *E, bool RequireType = false) { if (const UnaryExprOrTypeTraitExpr *SizeOf = - dyn_cast(E)) + dyn_cast(E)) if (SizeOf->getKind() == clang::UETT_SizeOf && (!RequireType || SizeOf->isArgumentType())) return SizeOf->getTypeOfArgument(); @@ -4755,20 +4755,19 @@ static bool isSizeOfArgFactorTypeCompatible(ASTContext &Context, QualType &SizeOfArgFactorTy, QualType &EltType) { - QualType LHSType = - Context.getCanonicalType(SizeOfArgFactorTy).getUnqualifiedType(); - QualType RHSType = - Context.getCanonicalType(EltType).getUnqualifiedType(); + QualType LHSType = + Context.getCanonicalType(SizeOfArgFactorTy).getUnqualifiedType(); + QualType RHSType = Context.getCanonicalType(EltType).getUnqualifiedType(); - if (LHSType->hasSignedIntegerRepresentation() && - LHSType != Context.getWCharType()) - LHSType = Context.getCorrespondingUnsignedType(LHSType); + if (LHSType->hasSignedIntegerRepresentation() && + LHSType != Context.getWCharType()) + LHSType = Context.getCorrespondingUnsignedType(LHSType); - if (RHSType->hasSignedIntegerRepresentation() && - RHSType != Context.getWCharType()) - RHSType = Context.getCorrespondingUnsignedType(RHSType); + if (RHSType->hasSignedIntegerRepresentation() && + RHSType != Context.getWCharType()) + RHSType = Context.getCorrespondingUnsignedType(RHSType); - return typesAreCompatibleIgnoreQualifiers(Context, LHSType, RHSType); + return typesAreCompatibleIgnoreQualifiers(Context, LHSType, RHSType); } /// \brief Check for dangerous or invalid arguments to memset(). @@ -4804,7 +4803,7 @@ const Expr *SizeOfArg = getSizeOfExprArg(LenExpr); QualType SizeOfArgFactorTy; - const Expr* OtherSizeOfFactor; + const Expr *OtherSizeOfFactor; bool SizeOfIsFactor = getSizeOfArgTypeProduct(LenExpr, SizeOfArgFactorTy, OtherSizeOfFactor); Index: test/SemaCXX/warn-memset-bad-sizeof.cpp =================================================================== --- test/SemaCXX/warn-memset-bad-sizeof.cpp +++ test/SemaCXX/warn-memset-bad-sizeof.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify -Wno-sizeof-array-argument %s // -#include +typedef __SIZE_TYPE__ size_t; extern "C" void *memset(void *, int, unsigned); extern "C" void *memmove(void *s1, const void *s2, unsigned n);