MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / NeedsNamespace

Function NeedsNamespace

InsightsHelpers.cpp:1025–1044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1023//-----------------------------------------------------------------------------
1024
1025static 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
1047static const SubstTemplateTypeParmType* GetSubstTemplateTypeParmType(const Type* t)

Callers 1

GetNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected