aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/include/clang/AST/DeclCXX.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/AST/DeclCXX.h')
-rw-r--r--contrib/llvm-project/clang/include/clang/AST/DeclCXX.h102
1 files changed, 38 insertions, 64 deletions
diff --git a/contrib/llvm-project/clang/include/clang/AST/DeclCXX.h b/contrib/llvm-project/clang/include/clang/AST/DeclCXX.h
index 2b8d7e879a0a..89006b1cfa7f 100644
--- a/contrib/llvm-project/clang/include/clang/AST/DeclCXX.h
+++ b/contrib/llvm-project/clang/include/clang/AST/DeclCXX.h
@@ -744,9 +744,14 @@ public:
///
/// This value is used for lazy creation of default constructors.
bool needsImplicitDefaultConstructor() const {
- return !data().UserDeclaredConstructor &&
- !(data().DeclaredSpecialMembers & SMF_DefaultConstructor) &&
- (!isLambda() || lambdaIsDefaultConstructibleAndAssignable());
+ return (!data().UserDeclaredConstructor &&
+ !(data().DeclaredSpecialMembers & SMF_DefaultConstructor) &&
+ (!isLambda() || lambdaIsDefaultConstructibleAndAssignable())) ||
+ // FIXME: Proposed fix to core wording issue: if a class inherits
+ // a default constructor and doesn't explicitly declare one, one
+ // is declared implicitly.
+ (data().HasInheritedDefaultConstructor &&
+ !(data().DeclaredSpecialMembers & SMF_DefaultConstructor));
}
/// Determine whether this class has any user-declared constructors.
@@ -1008,8 +1013,13 @@ public:
/// Retrieve the lambda static invoker, the address of which
/// is returned by the conversion operator, and the body of which
- /// is forwarded to the lambda call operator.
+ /// is forwarded to the lambda call operator. The version that does not
+ /// take a calling convention uses the 'default' calling convention for free
+ /// functions if the Lambda's calling convention was not modified via
+ /// attribute. Otherwise, it will return the calling convention specified for
+ /// the lambda.
CXXMethodDecl *getLambdaStaticInvoker() const;
+ CXXMethodDecl *getLambdaStaticInvoker(CallingConv CC) const;
/// Retrieve the generic lambda's template parameter list.
/// Returns null if the class does not represent a lambda or a generic
@@ -1025,7 +1035,7 @@ public:
}
/// Set the captures for this lambda closure type.
- void setCaptures(ArrayRef<LambdaCapture> Captures);
+ void setCaptures(ASTContext &Context, ArrayRef<LambdaCapture> Captures);
/// For a closure type, retrieve the mapping from captured
/// variables and \c this to the non-static data members that store the
@@ -1396,6 +1406,11 @@ public:
hasTrivialDefaultConstructor());
}
+ /// Determine whether this is a structural type.
+ bool isStructural() const {
+ return isLiteral() && data().StructuralIfLiteral;
+ }
+
/// If this record is an instantiation of a member class,
/// retrieves the member class from which it was instantiated.
///
@@ -1612,58 +1627,6 @@ public:
CXXBasePath &Path,
const CXXRecordDecl *BaseRecord);
- /// Base-class lookup callback that determines whether there exists
- /// a tag with the given name.
- ///
- /// This callback can be used with \c lookupInBases() to find tag members
- /// of the given name within a C++ class hierarchy.
- static bool FindTagMember(const CXXBaseSpecifier *Specifier,
- CXXBasePath &Path, DeclarationName Name);
-
- /// Base-class lookup callback that determines whether there exists
- /// a member with the given name.
- ///
- /// This callback can be used with \c lookupInBases() to find members
- /// of the given name within a C++ class hierarchy.
- static bool FindOrdinaryMember(const CXXBaseSpecifier *Specifier,
- CXXBasePath &Path, DeclarationName Name);
-
- /// Base-class lookup callback that determines whether there exists
- /// a member with the given name.
- ///
- /// This callback can be used with \c lookupInBases() to find members
- /// of the given name within a C++ class hierarchy, including dependent
- /// classes.
- static bool
- FindOrdinaryMemberInDependentClasses(const CXXBaseSpecifier *Specifier,
- CXXBasePath &Path, DeclarationName Name);
-
- /// Base-class lookup callback that determines whether there exists
- /// an OpenMP declare reduction member with the given name.
- ///
- /// This callback can be used with \c lookupInBases() to find members
- /// of the given name within a C++ class hierarchy.
- static bool FindOMPReductionMember(const CXXBaseSpecifier *Specifier,
- CXXBasePath &Path, DeclarationName Name);
-
- /// Base-class lookup callback that determines whether there exists
- /// an OpenMP declare mapper member with the given name.
- ///
- /// This callback can be used with \c lookupInBases() to find members
- /// of the given name within a C++ class hierarchy.
- static bool FindOMPMapperMember(const CXXBaseSpecifier *Specifier,
- CXXBasePath &Path, DeclarationName Name);
-
- /// Base-class lookup callback that determines whether there exists
- /// a member with the given name that can be used in a nested-name-specifier.
- ///
- /// This callback can be used with \c lookupInBases() to find members of
- /// the given name within a C++ class hierarchy that can occur within
- /// nested-name-specifiers.
- static bool FindNestedNameSpecifierMember(const CXXBaseSpecifier *Specifier,
- CXXBasePath &Path,
- DeclarationName Name);
-
/// Retrieve the final overriders for each virtual member
/// function in the class hierarchy where this class is the
/// most-derived class in the class hierarchy.
@@ -1672,12 +1635,20 @@ public:
/// Get the indirect primary bases for this class.
void getIndirectPrimaryBases(CXXIndirectPrimaryBaseSet& Bases) const;
+ /// Determine whether this class has a member with the given name, possibly
+ /// in a non-dependent base class.
+ ///
+ /// No check for ambiguity is performed, so this should never be used when
+ /// implementing language semantics, but it may be appropriate for warnings,
+ /// static analysis, or similar.
+ bool hasMemberName(DeclarationName N) const;
+
/// Performs an imprecise lookup of a dependent name in this class.
///
/// This function does not follow strict semantic rules and should be used
/// only when lookup rules can be relaxed, e.g. indexing.
std::vector<const NamedDecl *>
- lookupDependentName(const DeclarationName &Name,
+ lookupDependentName(DeclarationName Name,
llvm::function_ref<bool(const NamedDecl *ND)> Filter);
/// Renders and displays an inheritance diagram
@@ -1764,6 +1735,12 @@ public:
getLambdaData().HasKnownInternalLinkage = HasKnownInternalLinkage;
}
+ /// Set the device side mangling number.
+ void setDeviceLambdaManglingNumber(unsigned Num) const;
+
+ /// Retrieve the device side mangling number.
+ unsigned getDeviceLambdaManglingNumber() const;
+
/// Returns the inheritance model used for this record.
MSInheritanceModel getMSInheritanceModel() const;
@@ -1877,7 +1854,7 @@ private:
const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, SourceLocation EndLocation)
: FunctionDecl(CXXDeductionGuide, C, DC, StartLoc, NameInfo, T, TInfo,
- SC_None, false, CSK_unspecified),
+ SC_None, false, ConstexprSpecKind::Unspecified),
ExplicitSpec(ES) {
if (EndLocation.isValid())
setRangeEnd(EndLocation);
@@ -4070,11 +4047,8 @@ public:
/// Insertion operator for diagnostics. This allows sending an AccessSpecifier
/// into a diagnostic with <<.
-const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
- AccessSpecifier AS);
-
-const PartialDiagnostic &operator<<(const PartialDiagnostic &DB,
- AccessSpecifier AS);
+const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
+ AccessSpecifier AS);
} // namespace clang