diff options
Diffstat (limited to 'include/clang/Sema/Overload.h')
| -rw-r--r-- | include/clang/Sema/Overload.h | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/include/clang/Sema/Overload.h b/include/clang/Sema/Overload.h index 96fd5892daae5..96aadeac2ba38 100644 --- a/include/clang/Sema/Overload.h +++ b/include/clang/Sema/Overload.h @@ -1,9 +1,8 @@ //===- Overload.h - C++ Overloading -----------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -706,6 +705,11 @@ class Sema; /// attribute disabled it. ovl_fail_enable_if, + /// This candidate constructor or conversion fonction + /// is used implicitly but the explicit(bool) specifier + /// was resolved to true + ovl_fail_explicit_resolved, + /// This candidate was not viable because its address could not be taken. ovl_fail_addr_not_available, @@ -719,6 +723,11 @@ class Sema; /// This candidate was not viable because it is a non-default multiversioned /// function. ovl_non_default_multiversion_function, + + /// This constructor/conversion candidate fail due to an address space + /// mismatch between the object being constructed and the overload + /// candidate. + ovl_fail_object_addrspace_mismatch }; /// A list of implicit conversion sequences for the arguments of an @@ -874,6 +883,9 @@ class Sema; unsigned NumInlineBytesUsed = 0; llvm::AlignedCharArray<alignof(void *), NumInlineBytes> InlineSpace; + // Address space of the object being constructed. + LangAS DestAS = LangAS::Default; + /// If we have space, allocates from inline storage. Otherwise, allocates /// from the slab allocator. /// FIXME: It would probably be nice to have a SmallBumpPtrAllocator @@ -962,13 +974,34 @@ class Sema; OverloadingResult BestViableFunction(Sema &S, SourceLocation Loc, OverloadCandidateSet::iterator& Best); - void NoteCandidates(Sema &S, - OverloadCandidateDisplayKind OCD, - ArrayRef<Expr *> Args, + SmallVector<OverloadCandidate *, 32> CompleteCandidates( + Sema &S, OverloadCandidateDisplayKind OCD, ArrayRef<Expr *> Args, + SourceLocation OpLoc = SourceLocation(), + llvm::function_ref<bool(OverloadCandidate &)> Filter = + [](OverloadCandidate &) { return true; }); + + void NoteCandidates( + PartialDiagnosticAt PA, Sema &S, OverloadCandidateDisplayKind OCD, + ArrayRef<Expr *> Args, StringRef Opc = "", + SourceLocation Loc = SourceLocation(), + llvm::function_ref<bool(OverloadCandidate &)> Filter = + [](OverloadCandidate &) { return true; }); + + void NoteCandidates(Sema &S, ArrayRef<Expr *> Args, + ArrayRef<OverloadCandidate *> Cands, StringRef Opc = "", - SourceLocation Loc = SourceLocation(), - llvm::function_ref<bool(OverloadCandidate&)> Filter = - [](OverloadCandidate&) { return true; }); + SourceLocation OpLoc = SourceLocation()); + + LangAS getDestAS() { return DestAS; } + + void setDestAS(LangAS AS) { + assert((Kind == CSK_InitByConstructor || + Kind == CSK_InitByUserDefinedConversion) && + "can't set the destination address space when not constructing an " + "object"); + DestAS = AS; + } + }; bool isBetterOverloadCandidate(Sema &S, |
