File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1752
1752
If that lookup finds nothing, it undergoes unqualified name lookup;
1753
1753
in each case, only names
1754
1754
that denote types or templates whose specializations are types are considered.
1755
+ \begin {example }
1756
+ \begin {codeblock }
1757
+ struct T1 { struct U { int i; }; };
1758
+ struct T2 { };
1759
+ struct U1 {};
1760
+ struct U2 {};
1761
+
1762
+ struct B {
1763
+ using T = T1;
1764
+ using U = U1;
1765
+ operator U1 T1::*();
1766
+ operator U1 T2::*();
1767
+ operator U2 T1::*();
1768
+ operator U2 T2::*();
1769
+ };
1770
+
1771
+ template<class X, class T>
1772
+ int g() {
1773
+ using U = U2;
1774
+ X().operator U T::*(); // \# 1, searches for \tcode {T} in the scope of \tcode {X} first
1775
+ X().operator U decltype(T())::*(); // \# 2
1776
+ return 0;
1777
+ }
1778
+ int x = g<B, T2>(); // \# 1 calls \tcode {B::operator U1 T1::*}
1779
+ // \# 2 calls \tcode {B::operator U1 T2::*}
1780
+ \end {codeblock }
1781
+ \end {example }
1755
1782
1756
1783
\pnum
1757
1784
In a friend declaration \grammarterm {declarator}
You can’t perform that action at this time.
0 commit comments