| 892 | //----------------------------------------------------------------------------- |
| 893 | |
| 894 | static std::string GetName(QualType t, |
| 895 | const Unqualified unqualified = Unqualified::No, |
| 896 | const InsightsSuppressScope supressScope = InsightsSuppressScope::No) |
| 897 | { |
| 898 | const CppInsightsPrintingPolicy printingPolicy{unqualified, |
| 899 | supressScope, |
| 900 | (isa<AutoType>(t.getTypePtrOrNull())) ? InsightsCanonicalTypes::Yes |
| 901 | : InsightsCanonicalTypes::No}; |
| 902 | |
| 903 | if(SimpleTypePrinter st{t, printingPolicy}; st.GetTypeString()) { |
| 904 | return ScopeHandler::RemoveCurrentScope(st.GetString()); |
| 905 | } |
| 906 | |
| 907 | // To get the namespace handling right we need to look into the ElaboratedType in some cases. |
| 908 | // However, only do that, if the type it not a dependent type. A dependent type might cause type-parameter stuff. |
| 909 | if(const auto* et = t->getAs<ElaboratedType>(); |
| 910 | et and (nullptr == et->getQualifier()) and (nullptr == et->getOwnedTagDecl()) and not et->isDependentType()) { |
| 911 | const auto quals = t.getLocalFastQualifiers(); |
| 912 | t = et->getNamedType(); |
| 913 | t.setLocalFastQualifiers(quals); |
| 914 | } |
| 915 | |
| 916 | if(true == printingPolicy.CppInsightsUnqualified) { |
| 917 | t = t.getUnqualifiedType(); |
| 918 | } |
| 919 | |
| 920 | return ScopeHandler::RemoveCurrentScope(GetAsCPPStyleString(t, printingPolicy)); |
| 921 | } |
| 922 | } // namespace details |
| 923 | //----------------------------------------------------------------------------- |
| 924 |
no test coverage detected