|
2329 | 2329 |
|
2330 | 2330 | \item
|
2331 | 2331 | Otherwise,
|
2332 |
| -if \tcode{T} is a function type, or |
2333 | 2332 | if the type of the argument is possibly cv-qualified \tcode{T}, or
|
2334 | 2333 | if \tcode{T} is an array type of unknown bound with element type \tcode{U} and
|
2335 | 2334 | the argument has an array type of known bound whose
|
2336 | 2335 | element type is possibly cv-qualified \tcode{U},
|
2337 | 2336 | the implicit conversion sequence is the identity conversion.
|
2338 |
| -\begin{note} |
2339 |
| -When \tcode{T} is a function type, |
2340 |
| -the type of the argument can differ only by the presence of \keyword{noexcept}. |
2341 |
| -\end{note} |
| 2337 | + |
| 2338 | +\item |
| 2339 | +Otherwise, |
| 2340 | +if \tcode{T} is a function type, |
| 2341 | +the implicit conversion sequence is a function pointer conversion. |
2342 | 2342 |
|
2343 | 2343 | \item
|
2344 | 2344 | Otherwise, the implicit conversion sequence is a qualification conversion.
|
|
2351 | 2351 | int f(A&);
|
2352 | 2352 | int f(B&);
|
2353 | 2353 | int i = f(b); // calls \tcode{f(B\&)}, an exact match, rather than \tcode{f(A\&)}, a conversion
|
| 2354 | + |
| 2355 | +void g() noexcept; |
| 2356 | +int h(void (&)() noexcept); // \#1 |
| 2357 | +int h(void (&)()); // \#2 |
| 2358 | +int j = h(g); // calls \#1, an exact match, rather than \#2, a function pointer conversion |
2354 | 2359 | \end{codeblock}
|
2355 | 2360 | \end{example}
|
2356 | 2361 | If the parameter binds directly to the result of
|
|
2835 | 2840 | b.f(); // calls \tcode{X::f()}
|
2836 | 2841 | }
|
2837 | 2842 |
|
2838 |
| -int h1(int (&)[]); |
2839 |
| -int h1(int (&)[1]); |
2840 |
| -int h2(void (&)()); |
2841 |
| -int h2(void (&)() noexcept); |
| 2843 | +int h(int (&)[]); |
| 2844 | +int h(int (&)[1]); |
2842 | 2845 | void g2() {
|
2843 | 2846 | int a[1];
|
2844 |
| - h1(a); // calls \tcode{h1(int (\&)[1])} |
2845 |
| - extern void f2() noexcept; |
2846 |
| - h2(f2); // calls \tcode{h2(void (\&)() noexcept)} |
| 2847 | + h(a); // calls \tcode{h(int (\&)[1])} |
2847 | 2848 | }
|
2848 | 2849 | \end{codeblock}
|
2849 | 2850 | \end{example}
|
|
0 commit comments