aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-11-05 16:36:20 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-11-05 16:36:20 +0000
commita65b55142bd8e8c94f371bb056d8f58f11de220f (patch)
tree69c20e7c16490349645185a27ef561aee13d2a06 /lib/Sema/SemaOverload.cpp
parentb258d8f961212490800f96b97275dd6961ca1cc0 (diff)
When collecting types for built-in candidates, make arrays decay to pointers. Otherwise, subscripting an array leads to no candidates at all. Fixes PR5360.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 24c3ae391b..3e6778bc47 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -3052,6 +3052,10 @@ BuiltinCandidateTypeSet::AddTypesConvertedFrom(QualType Ty,
// We don't care about qualifiers on the type.
Ty = Ty.getUnqualifiedType();
+ // If we're dealing with an array type, decay to the pointer.
+ if (Ty->isArrayType())
+ Ty = SemaRef.Context.getArrayDecayedType(Ty);
+
if (const PointerType *PointerTy = Ty->getAs<PointerType>()) {
QualType PointeeTy = PointerTy->getPointeeType();