| 1023 | //----------------------------------------------------------------------------- |
| 1024 | |
| 1025 | static bool NeedsNamespace(const Decl& decl, UseLexicalParent useLexicalParent) |
| 1026 | { |
| 1027 | const auto* declCtx = decl.getDeclContext(); |
| 1028 | if(UseLexicalParent::Yes == useLexicalParent) { |
| 1029 | declCtx = declCtx->getLexicalParent(); |
| 1030 | } |
| 1031 | |
| 1032 | if(nullptr == declCtx) { |
| 1033 | return false; |
| 1034 | } |
| 1035 | |
| 1036 | const bool isFriend{(decl.getFriendObjectKind() != Decl::FOK_None)}; |
| 1037 | const bool neitherTransparentNorFriend{not declCtx->isTransparentContext() and not isFriend}; |
| 1038 | |
| 1039 | if(UseLexicalParent::Yes == useLexicalParent) { |
| 1040 | return (declCtx->isNamespace() and not declCtx->isInlineNamespace()) and neitherTransparentNorFriend; |
| 1041 | } |
| 1042 | |
| 1043 | return (declCtx->isNamespace() or declCtx->isInlineNamespace()) and neitherTransparentNorFriend; |
| 1044 | } |
| 1045 | //----------------------------------------------------------------------------- |
| 1046 | |
| 1047 | static const SubstTemplateTypeParmType* GetSubstTemplateTypeParmType(const Type* t) |