diff options
| author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-11-05 16:36:20 +0000 |
|---|---|---|
| committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-11-05 16:36:20 +0000 |
| commit | 65ae200a131d0ec00d9a7f7979102305059cef38 (patch) | |
| tree | 139a982494a594d559e4f1c7614a7222a0c0fb9e /clang/lib/Sema | |
| parent | d3f630f4d51eaf73d9a1247dac6fa7f5574e9a32 (diff) | |
| download | bcm5719-llvm-65ae200a131d0ec00d9a7f7979102305059cef38.tar.gz bcm5719-llvm-65ae200a131d0ec00d9a7f7979102305059cef38.zip | |
When collecting types for built-in candidates, make arrays decay to pointers. Otherwise, subscripting an array leads to no candidates at all. Fixes PR5360.
llvm-svn: 86140
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 24c3ae391b5..3e6778bc477 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/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(); |

