| 136 | //----------------------------------------------------------------------------- |
| 137 | |
| 138 | static std::string GetSpecialMemberName(const ValueDecl* vd, QualType type) |
| 139 | { |
| 140 | if(const auto* md = dyn_cast_or_null<CXXMethodDecl>(vd)) { |
| 141 | // GetName below would return a[4] for example. To avoid the array part we go for the underlying type. |
| 142 | if(const auto* ar = dyn_cast_or_null<ArrayType>(type)) { |
| 143 | type = ar->getElementType(); |
| 144 | } |
| 145 | |
| 146 | auto rdName = GetName(type); |
| 147 | |
| 148 | if(const auto* ctor = dyn_cast_or_null<CXXConstructorDecl>(md)) { |
| 149 | if(ctor->isCopyConstructor()) { |
| 150 | return StrCat("CopyConstructor_"sv, rdName); |
| 151 | } else if(ctor->isMoveConstructor()) { |
| 152 | return StrCat("MoveConstructor_"sv, rdName); |
| 153 | } |
| 154 | |
| 155 | return StrCat("Constructor_"sv, rdName); |
| 156 | |
| 157 | } else if(isa<CXXDestructorDecl>(md)) { |
| 158 | return StrCat("Destructor_"sv, rdName); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | return GetName(*vd); |
| 163 | } |
| 164 | //----------------------------------------------------------------------------- |
| 165 | |
| 166 | std::string GetSpecialMemberName(const ValueDecl* vd) |
no test coverage detected