| 164 | |
| 165 | namespace details { |
| 166 | static void |
| 167 | BuildNamespace(std::string& fullNamespace, const NestedNameSpecifier* stmt, const IgnoreNamespace ignoreNamespace) |
| 168 | { |
| 169 | RETURN_IF(not stmt); |
| 170 | |
| 171 | if(const auto* prefix = stmt->getPrefix()) { |
| 172 | BuildNamespace(fullNamespace, prefix, ignoreNamespace); |
| 173 | } |
| 174 | |
| 175 | switch(stmt->getKind()) { |
| 176 | case NestedNameSpecifier::Identifier: fullNamespace.append(stmt->getAsIdentifier()->getName()); break; |
| 177 | |
| 178 | case NestedNameSpecifier::Namespace: |
| 179 | RETURN_IF((IgnoreNamespace::Yes == ignoreNamespace) or (stmt->getAsNamespace()->isAnonymousNamespace())); |
| 180 | |
| 181 | fullNamespace.append(stmt->getAsNamespace()->getName()); |
| 182 | break; |
| 183 | |
| 184 | case NestedNameSpecifier::NamespaceAlias: fullNamespace.append(stmt->getAsNamespaceAlias()->getName()); break; |
| 185 | #if IS_CLANG_NEWER_THAN(20) |
| 186 | #else |
| 187 | case NestedNameSpecifier::TypeSpecWithTemplate: |
| 188 | if(auto* dependentSpecType = stmt->getAsType()->getAs<DependentTemplateSpecializationType>()) { |
| 189 | fullNamespace.append(GetElaboratedTypeKeyword(dependentSpecType->getKeyword())); |
| 190 | } |
| 191 | |
| 192 | [[fallthrough]]; |
| 193 | #endif |
| 194 | case NestedNameSpecifier::TypeSpec: |
| 195 | fullNamespace.append(GetUnqualifiedScopelessName(stmt->getAsType(), InsightsSuppressScope::Yes)); |
| 196 | // The template parameters are already contained in the type we inserted above. |
| 197 | break; |
| 198 | |
| 199 | default: break; |
| 200 | } |
| 201 | |
| 202 | fullNamespace.append("::"sv); |
| 203 | } |
| 204 | //----------------------------------------------------------------------------- |
| 205 | } // namespace details |
| 206 |
no test coverage detected