Skip to content

Commit 71c07ac

Browse files
committed
clarify that the proposed fix violates the C++ standard
1 parent a85ad77 commit 71c07ac

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clang/lib/Sema/SemaOverload.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6986,11 +6986,12 @@ void Sema::AddOverloadCandidate(
69866986
}
69876987

69886988
/// Don't remove inline functions with internal linkage from the overload
6989-
/// set if they are declared in a GMF.
6990-
/// The global module is meant to be a transition mechanism for C and C++
6991-
/// headers.
6992-
/// Inline functions with internal linkage are a common pattern in headers
6993-
/// to avoid ODR issues.
6989+
/// set if they are declared in a GMF, in violation of C++ [basic.link]p17.
6990+
/// However:
6991+
/// - Inline functions with internal linkage are a common pattern in
6992+
/// headers to avoid ODR issues.
6993+
/// - The global module is meant to be a transition mechanism for C and C++
6994+
/// headers, and the current rules as written work against that goal.
69946995
const bool IsInlineFunctionInGMF =
69956996
Function->isFromGlobalModule() &&
69966997
(IsImplicitlyInstantiated || Function->isInlined());

0 commit comments

Comments
 (0)