File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -6197,9 +6197,17 @@ int TemplateInstance::hasNestedArgs(Objects *args)
6197
6197
Lsa :
6198
6198
sa = sa -> toAlias ();
6199
6199
TemplateDeclaration * td = sa -> isTemplateDeclaration ();
6200
+ if (td )
6201
+ {
6202
+ TemplateInstance * ti = sa -> toParent ()-> isTemplateInstance ();
6203
+ if (ti && ti -> enclosing )
6204
+ sa = ti ;
6205
+ }
6206
+ TemplateInstance * ti = sa -> isTemplateInstance ();
6200
6207
AggregateDeclaration * ad = sa -> isAggregateDeclaration ();
6201
6208
Declaration * d = sa -> isDeclaration ();
6202
6209
if ((td && td -> literal ) ||
6210
+ (ti && ti -> enclosing ) ||
6203
6211
#if FIXBUG8863
6204
6212
(ad && ad -> isNested ()) ||
6205
6213
#endif
Original file line number Diff line number Diff line change @@ -2173,6 +2173,23 @@ void test9536()
2173
2173
assert (s.bar() == 84 );
2174
2174
}
2175
2175
2176
+ /* *********************************/
2177
+ // 9578
2178
+
2179
+ template t9578 (alias f) { void tf()() { f(); } }
2180
+
2181
+ void g9578a (alias f)() { f(); } // Error -> OK
2182
+ void g9578b (alias ti)() { ti.tf(); } // Error -> OK
2183
+
2184
+ void test9578 ()
2185
+ {
2186
+ int i = 0 ;
2187
+ int m () { return i; }
2188
+
2189
+ g9578a! (t9578! m.tf)();
2190
+ g9578b! (t9578! m)();
2191
+ }
2192
+
2176
2193
/* *********************************/
2177
2194
// 9596
2178
2195
@@ -2801,6 +2818,7 @@ int main()
2801
2818
test9143();
2802
2819
test9266();
2803
2820
test9536();
2821
+ test9578();
2804
2822
test9596();
2805
2823
test9837();
2806
2824
test9874();
You can’t perform that action at this time.
0 commit comments