Skip to content

Commit 0c6f5bc

Browse files
burblebeetkoeppe
authored andcommitted
CWG2588 friend declarations and module linkage
1 parent 4596a87 commit 0c6f5bc

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
@@ -4860,12 +4860,6 @@
48604860
\end{codeblock}
48614861
\end{example}
48624862

4863-
\pnum
4864-
\indextext{friend function!linkage of}%
4865-
A function first declared in a friend declaration
4866-
has the linkage of the namespace of which it is a member\iref{basic.link}.
4867-
Otherwise, the function retains its previous linkage\iref{dcl.stc}.
4868-
48694863
\pnum
48704864
\indextext{declaration!overloaded name and \tcode{friend}}%
48714865
\begin{note}

0 commit comments

Comments
 (0)