@@ -1199,14 +1199,17 @@ class Sema;
1199
1199
llvm::SmallPtrSet<uintptr_t , 16 > Functions;
1200
1200
SmallVector<DeferredTemplateOverloadCandidate, 8 > DeferredCandidates;
1201
1201
1202
- // Allocator for ConversionSequenceLists. We store the first few of these
1202
+ // Allocator for ConversionSequenceLists and deferred candidate args.
1203
+ // We store the first few of these
1203
1204
// inline to avoid allocation for small sets.
1204
1205
llvm::BumpPtrAllocator SlabAllocator;
1205
1206
1206
1207
SourceLocation Loc;
1207
1208
CandidateSetKind Kind;
1208
1209
OperatorRewriteInfo RewriteInfo;
1209
1210
1211
+ // / Small storage size for ImplicitConversionSequences
1212
+ // / and the persisted arguments of deferred candidates.
1210
1213
constexpr static unsigned NumInlineBytes =
1211
1214
32 * sizeof (ImplicitConversionSequence);
1212
1215
@@ -1304,6 +1307,11 @@ class Sema;
1304
1307
return ConversionSequenceList (Conversions, NumConversions);
1305
1308
}
1306
1309
1310
+ // / Provide storage for any Expr* arg that must be preserved
1311
+ // / until deferred template candidates are deduced.
1312
+ // / Typically this should be used for reversed operator arguments
1313
+ // / and any time the argument array is transformed while adding
1314
+ // / a template candidate.
1307
1315
llvm::MutableArrayRef<Expr *> getPersistentArgsArray (unsigned N) {
1308
1316
Expr **Exprs = slabAllocate<Expr *>(N);
1309
1317
return llvm::MutableArrayRef<Expr *>(Exprs, N);
@@ -1454,10 +1462,9 @@ class Sema;
1454
1462
// When doing code completion, we want to see all the
1455
1463
// viable candidates.
1456
1464
&& Kind != CSK_CodeCompletion
1457
- // When -fgpu-exclude-wrong-side-overloads, CUDA needs
1458
- // to exclude templates from the overload sets after they
1459
- // have been instantiated. See CudaExcludeWrongSideCandidates.
1460
- && (!Opts.CUDA || !Opts.GPUExcludeWrongSideOverloads );
1465
+ // CUDA may prefer template candidates even when a non-candidate
1466
+ // is a perfect match
1467
+ && !Opts.CUDA ;
1461
1468
}
1462
1469
1463
1470
} // namespace clang
0 commit comments