diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-07 06:58:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-07 06:58:21 +0000 |
commit | 8c7bbb5347a74f7f470231a149dd3455fbe0bcc6 (patch) | |
tree | 1c20e61b9da38d75c039d8de9e36cd57bf9e1911 /lib/AST/ASTContext.cpp | |
parent | acc9972da24df89ea283d6f979ffbd0e4fa0e1a5 (diff) |
fix a bug I introduced in my previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 4de367551f..41b00d9535 100644 --- a/lib/AST/ASTContext.cpp +++ b/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<ConstantArrayType>(LHS)) if (const ConstantArrayType* RCAT = dyn_cast<ConstantArrayType>(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 |