From fa00732562e3f7034a78c6e81c783f54cc79f564 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 7 Apr 2008 06:58:21 +0000 Subject: fix a bug I introduced in my previous checkin. llvm-svn: 49327 --- clang/lib/AST/ASTContext.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'clang/lib/AST/ASTContext.cpp') diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 4de367551f0..41b00d9535e 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1515,17 +1515,14 @@ bool ASTContext::functionTypesAreCompatible(QualType lhs, QualType rhs) { // C99 6.7.5.2p6 static bool areCompatArrayTypes(ArrayType *LHS, ArrayType *RHS, ASTContext &C) { - // Compatible arrays must have compatible element types - QualType ltype = LHS->getElementType(); - QualType rtype = RHS->getElementType(); - // Constant arrays must be the same size to be compatible. if (const ConstantArrayType* LCAT = dyn_cast(LHS)) if (const ConstantArrayType* RCAT = dyn_cast(RHS)) if (RCAT->getSize() != LCAT->getSize()) return false; - return C.typesAreCompatible(QualType(LHS, 0), QualType(RHS, 0)); + // Compatible arrays must have compatible element types + return C.typesAreCompatible(LHS->getElementType(), RHS->getElementType()); } /// areCompatVectorTypes - Return true if the two specified vector types are -- cgit v1.2.3