summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-11-19 22:57:39 +0000
committerDouglas Gregor <dgregor@apple.com>2008-11-19 22:57:39 +0000
commitab7897ac447696c75db26e5f9ae4394e372fede8 (patch)
tree5303b3e87c3ae0df677e3bf7182a8a2077dbfa6a /clang/lib/Sema/SemaOverload.h
parent5b75170014bc3e723b7db1ef09e9f51a86582fed (diff)
downloadbcm5719-llvm-ab7897ac447696c75db26e5f9ae4394e372fede8.tar.gz
bcm5719-llvm-ab7897ac447696c75db26e5f9ae4394e372fede8.zip
Implement the rest of C++ [over.call.object], which permits the object
being called to be converted to a reference-to-function, pointer-to-function, or reference-to-pointer-to-function. This is done through "surrogate" candidate functions that model the conversions from the object to the function (reference/pointer) and the conversions in the arguments. llvm-svn: 59674
Diffstat (limited to 'clang/lib/Sema/SemaOverload.h')
-rw-r--r--clang/lib/Sema/SemaOverload.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaOverload.h b/clang/lib/Sema/SemaOverload.h
index 24b796b2114..13be00ad7f6 100644
--- a/clang/lib/Sema/SemaOverload.h
+++ b/clang/lib/Sema/SemaOverload.h
@@ -199,15 +199,21 @@ namespace clang {
/// OverloadCandidate - A single candidate in an overload set (C++ 13.3).
struct OverloadCandidate {
/// Function - The actual function that this candidate
- /// represents. When NULL, this is a built-in candidate.
+ /// represents. When NULL, this is a built-in candidate
+ /// (C++ [over.oper]) or a surrogate for a conversion to a
+ /// function pointer or reference (C++ [over.call.object]).
FunctionDecl *Function;
-
+
// BuiltinTypes - Provides the return and parameter types of a
// built-in overload candidate. Only valid when Function is NULL.
struct {
QualType ResultTy;
QualType ParamTypes[3];
} BuiltinTypes;
+
+ /// Surrogate - The conversion function for which this candidate
+ /// is a surrogate, but only if IsSurrogate is true.
+ CXXConversionDecl *Surrogate;
/// Conversions - The conversion sequences used to convert the
/// function arguments to the function parameters.
@@ -216,6 +222,11 @@ namespace clang {
/// Viable - True to indicate that this overload candidate is viable.
bool Viable;
+ /// IsSurrogate - True to indicate that this candidate is a
+ /// surrogate for a conversion to a function pointer or reference
+ /// (C++ [over.call.object]).
+ bool IsSurrogate;
+
/// FinalConversion - For a conversion function (where Function is
/// a CXXConversionDecl), the standard conversion that occurs
/// after the call to the overload candidate to convert the result
OpenPOWER on IntegriCloud