C++: Anonymous namespaces provide internal linkage.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-04-09 15:25:13 +01:00
parent 2a7420ce11
commit 291cc0a671

View File

@@ -120,10 +120,13 @@ private module Input implements TypeFlowInput<Location> {
* calls to this function.
*/
private predicate isPrivate(Function func) {
// static functions have internal linkage
func.isStatic()
or
func.getNamespace().getParentNamespace*().isInline()
// anonymous namespaces have internal linkage
func.getNamespace().getParentNamespace*().isAnonymous()
or
// private member functions are only called internally from inside the class
func.(MemberFunction).isPrivate()
}