Skip to content

Commit 39b7d21

Browse files
committed
CWG2588 friend declarations and module linkage
1 parent a4db413 commit 39b7d21

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

source/basic.tex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,6 +2746,24 @@
27462746
has its linkage determined as follows:
27472747
\begin{itemize}
27482748
\item
2749+
\indextext{friend function!linkage of}%
2750+
if the entity is a function or function template
2751+
first declared in a friend declaration and
2752+
that declaration is a definition and
2753+
the enclosing class is defined within an \grammarterm{export-declaration},
2754+
the name has the same linkage, if any,
2755+
as the name of the enclosing class\iref{class.friend};
2756+
\item
2757+
otherwise,
2758+
\indextext{friend function!linkage of}%
2759+
if the entity is a function or function template
2760+
declared in a friend declaration and
2761+
a corresponding non-friend declaration is reachable,
2762+
%FIXME: Which declaration is "that prior declaration"?
2763+
%FIXME: "prior" with respect to what? And what about dependent lookup?
2764+
the name has the linkage determined from that prior declaration,
2765+
\item
2766+
otherwise,
27492767
if the enclosing namespace has internal linkage,
27502768
the name has internal linkage;
27512769
\item

source/classes.tex

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4857,12 +4857,6 @@
48574857
\end{codeblock}
48584858
\end{example}
48594859

4860-
\pnum
4861-
\indextext{friend function!linkage of}%
4862-
A function first declared in a friend declaration
4863-
has the linkage of the namespace of which it is a member\iref{basic.link}.
4864-
Otherwise, the function retains its previous linkage\iref{dcl.stc}.
4865-
48664860
\pnum
48674861
\indextext{declaration!overloaded name and \tcode{friend}}%
48684862
\begin{note}

0 commit comments

Comments
 (0)