File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2882,6 +2882,10 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
28822882 // / - DecayedType
28832883 QualType getPointeeType () const ;
28842884
2885+ // / Return getElementType() if this is an array type, and getPointeeType()
2886+ // / otherwise.
2887+ QualType getPointerLikeOrArrayElementType () const ;
2888+
28852889 // / Return the specified type with any "sugar" removed from the type,
28862890 // / removing any typedefs, typeofs, etc., as well as any qualifiers.
28872891 const Type *getUnqualifiedDesugaredType () const ;
Original file line number Diff line number Diff line change @@ -751,6 +751,12 @@ QualType Type::getPointeeType() const {
751751 return {};
752752}
753753
754+ QualType Type::getPointerLikeOrArrayElementType () const {
755+ if (const auto *A = getAs<ArrayType>())
756+ return A->getElementType ();
757+ return getPointeeType ();
758+ }
759+
754760const RecordType *Type::getAsStructureType () const {
755761 // If this is directly a structure type, return it.
756762 if (const auto *RT = dyn_cast<RecordType>(this )) {
You can’t perform that action at this time.
0 commit comments