tmp/tmpz6rl2mwh/{from.md → to.md}
RENAMED
|
@@ -70,26 +70,17 @@ If two different points of instantiation give a template specialization
|
|
| 70 |
different meanings according to the one-definition rule
|
| 71 |
[[basic.def.odr]], the program is ill-formed, no diagnostic required.
|
| 72 |
|
| 73 |
#### Candidate functions <a id="temp.dep.candidate">[[temp.dep.candidate]]</a>
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
[
|
| 81 |
-
|
| 82 |
-
instantiation context are found by this lookup, as described in
|
| 83 |
-
[[basic.lookup.argdep]]. — *end note*]
|
| 84 |
-
|
| 85 |
-
If the call would be ill-formed or would find a better match had the
|
| 86 |
-
lookup within the associated namespaces considered all the function
|
| 87 |
-
declarations with external linkage introduced in those namespaces in all
|
| 88 |
-
translation units, not just considering those declarations found in the
|
| 89 |
-
template definition and template instantiation contexts, then the
|
| 90 |
-
program has undefined behavior.
|
| 91 |
|
| 92 |
[*Example 1*:
|
| 93 |
|
| 94 |
Source file \`"X.h"\`
|
| 95 |
|
|
@@ -189,11 +180,11 @@ Module interface unit of \`M\`
|
|
| 189 |
module;
|
| 190 |
#include "X.h"
|
| 191 |
export module M;
|
| 192 |
import F;
|
| 193 |
void g(X x) {
|
| 194 |
-
f(x); // OK
|
| 195 |
// operator+ is visible in instantiation context
|
| 196 |
}
|
| 197 |
```
|
| 198 |
|
| 199 |
— *end example*]
|
|
|
|
| 70 |
different meanings according to the one-definition rule
|
| 71 |
[[basic.def.odr]], the program is ill-formed, no diagnostic required.
|
| 72 |
|
| 73 |
#### Candidate functions <a id="temp.dep.candidate">[[temp.dep.candidate]]</a>
|
| 74 |
|
| 75 |
+
If a dependent call [[temp.dep]] would be ill-formed or would find a
|
| 76 |
+
better match had the lookup for its dependent name considered all the
|
| 77 |
+
function declarations with external linkage introduced in the associated
|
| 78 |
+
namespaces in all translation units, not just considering those
|
| 79 |
+
declarations found in the template definition and template instantiation
|
| 80 |
+
contexts [[basic.lookup.argdep]], then the program is ill-formed, no
|
| 81 |
+
diagnostic required.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
[*Example 1*:
|
| 84 |
|
| 85 |
Source file \`"X.h"\`
|
| 86 |
|
|
|
|
| 180 |
module;
|
| 181 |
#include "X.h"
|
| 182 |
export module M;
|
| 183 |
import F;
|
| 184 |
void g(X x) {
|
| 185 |
+
f(x); // OK, instantiates f from F,
|
| 186 |
// operator+ is visible in instantiation context
|
| 187 |
}
|
| 188 |
```
|
| 189 |
|
| 190 |
— *end example*]
|