Skip to content

Commit ff44122

Browse files
author
Dawn Perchik
committed
CWG2059 Linkage and deduced return types
1 parent 218e76a commit ff44122

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

source/basic.tex

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,21 +2470,12 @@
24702470
\item it is a cv-qualified\iref{basic.type.qualifier} version of a
24712471
type that has linkage.
24722472
\end{itemize}
2473-
A type without linkage shall not be used as the type of a variable or
2474-
function with external linkage unless
2475-
\begin{itemize}
2476-
\item the entity has C language linkage\iref{dcl.link}, or
2477-
2478-
\item the entity is not odr-used\iref{basic.def.odr} or is defined in
2479-
the same translation unit.
2480-
\end{itemize}
24812473
\begin{note}
24822474
In other words, a type without linkage contains a class or enumeration that
2483-
cannot be named outside its translation unit. An entity with external linkage declared
2484-
using such a type could not correspond to any other entity in another translation unit
2485-
of the program and thus must be defined in the
2486-
translation unit if it is odr-used. Also note that classes with linkage may contain members
2487-
whose types do not have linkage, and that typedef names are ignored in the determination
2475+
cannot be named outside its translation unit.
2476+
Classes with linkage may contain members
2477+
whose types do not have linkage.
2478+
Typedef names are ignored in the determination
24882479
of whether a type has linkage.
24892480
\end{note}
24902481

@@ -2501,7 +2492,7 @@
25012492
A a = { 1 };
25022493
B<A> ba; // declares \tcode{B<A>::g(A)} and \tcode{B<A>::h(A)}
25032494
ba.g(a); // OK
2504-
ba.h(a); // error: \tcode{B<A>::h(A) not defined in the translation unit}
2495+
ba.h(a); // error: \tcode{B<A>::h(A)} not defined; \tcode{A} cannot be named in another translation unit
25052496
i(ba, a); // OK
25062497
}
25072498
\end{codeblock}

0 commit comments

Comments
 (0)