From Jason Turner

[temp.dep.candidate]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpjl1itv13/{from.md → to.md} +8 -17
tmp/tmpjl1itv13/{from.md → to.md} RENAMED
@@ -1,23 +1,14 @@
1
  #### Candidate functions <a id="temp.dep.candidate">[[temp.dep.candidate]]</a>
2
 
3
- For a function call where the *postfix-expression* is a dependent name,
4
- the candidate functions are found using the usual lookup rules from the
5
- template definition context ([[basic.lookup.unqual]],
6
- [[basic.lookup.argdep]]).
7
-
8
- [*Note 1*: For the part of the lookup using associated namespaces
9
- [[basic.lookup.argdep]], function declarations found in the template
10
- instantiation context are found by this lookup, as described in
11
- [[basic.lookup.argdep]]. — *end note*]
12
-
13
- If the call would be ill-formed or would find a better match had the
14
- lookup within the associated namespaces considered all the function
15
- declarations with external linkage introduced in those namespaces in all
16
- translation units, not just considering those declarations found in the
17
- template definition and template instantiation contexts, then the
18
- program has undefined behavior.
19
 
20
  [*Example 1*:
21
 
22
  Source file \`"X.h"\`
23
 
@@ -117,11 +108,11 @@ Module interface unit of \`M\`
117
  module;
118
  #include "X.h"
119
  export module M;
120
  import F;
121
  void g(X x) {
122
- f(x); // OK: instantiates f from F,
123
  // operator+ is visible in instantiation context
124
  }
125
  ```
126
 
127
  — *end example*]
 
1
  #### Candidate functions <a id="temp.dep.candidate">[[temp.dep.candidate]]</a>
2
 
3
+ If a dependent call [[temp.dep]] would be ill-formed or would find a
4
+ better match had the lookup for its dependent name considered all the
5
+ function declarations with external linkage introduced in the associated
6
+ namespaces in all translation units, not just considering those
7
+ declarations found in the template definition and template instantiation
8
+ contexts [[basic.lookup.argdep]], then the program is ill-formed, no
9
+ diagnostic required.
 
 
 
 
 
 
 
 
 
10
 
11
  [*Example 1*:
12
 
13
  Source file \`"X.h"\`
14
 
 
108
  module;
109
  #include "X.h"
110
  export module M;
111
  import F;
112
  void g(X x) {
113
+ f(x); // OK, instantiates f from F,
114
  // operator+ is visible in instantiation context
115
  }
116
  ```
117
 
118
  — *end example*]