File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -8042,8 +8042,8 @@ static void AddTemplateOverloadCandidateImmediately(
8042
8042
8043
8043
Candidate.IgnoreObjectArgument =
8044
8044
isa<CXXMethodDecl>(Candidate.Function) &&
8045
- cast<CXXMethodDecl>(Candidate.Function)
8046
- ->isImplicitObjectMemberFunction () &&
8045
+ ! cast<CXXMethodDecl>(Candidate.Function)
8046
+ ->isExplicitObjectMemberFunction () &&
8047
8047
!isa<CXXConstructorDecl>(Candidate.Function);
8048
8048
8049
8049
Candidate.ExplicitCallArguments = Args.size();
Original file line number Diff line number Diff line change @@ -1357,3 +1357,35 @@ void Bar(this int) { // expected-note {{candidate function}}
1357
1357
}
1358
1358
1359
1359
}
1360
+
1361
+ namespace GH147046_regression {
1362
+
1363
+ template <typename z> struct ai {
1364
+ ai (z::ah);
1365
+ };
1366
+
1367
+ template <typename z> struct ak {
1368
+ template <typename am> void an (am, z);
1369
+ template <typename am> static void an (am, ai<z>);
1370
+ };
1371
+ template <typename > struct ao {};
1372
+
1373
+ template <typename ap>
1374
+ auto ar (ao<ap> at) -> decltype(ak<ap>::an(at, 0 ));
1375
+ // expected-note@-1 {{candidate template ignored: substitution failure [with ap = GH147046_regression::ay]: no matching function for call to 'an'}}
1376
+
1377
+ class aw ;
1378
+ struct ax {
1379
+ typedef int ah;
1380
+ };
1381
+ struct ay {
1382
+ typedef aw ah;
1383
+ };
1384
+
1385
+ ao<ay> az ;
1386
+ ai<ax> bd (0 );
1387
+ void f () {
1388
+ ar (az); // expected-error {{no matching function for call to 'ar'}}
1389
+ }
1390
+
1391
+ }
You can’t perform that action at this time.
0 commit comments