diff options
Diffstat (limited to 'include/clang/Sema/DeclSpec.h')
-rw-r--r-- | include/clang/Sema/DeclSpec.h | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/include/clang/Sema/DeclSpec.h b/include/clang/Sema/DeclSpec.h index bc817150ab82..760a04d3c8d2 100644 --- a/include/clang/Sema/DeclSpec.h +++ b/include/clang/Sema/DeclSpec.h @@ -280,6 +280,7 @@ public: static const TST TST_half = clang::TST_half; static const TST TST_float = clang::TST_float; static const TST TST_double = clang::TST_double; + static const TST TST_float16 = clang::TST_Float16; static const TST TST_float128 = clang::TST_float128; static const TST TST_bool = clang::TST_bool; static const TST TST_decimal32 = clang::TST_decimal32; @@ -360,9 +361,6 @@ private: // constexpr-specifier unsigned Constexpr_specified : 1; - // concept-specifier - unsigned Concept_specified : 1; - union { UnionParsedType TypeRep; Decl *DeclRep; @@ -392,7 +390,7 @@ private: TQ_unalignedLoc; SourceLocation FS_inlineLoc, FS_virtualLoc, FS_explicitLoc, FS_noreturnLoc; SourceLocation FS_forceinlineLoc; - SourceLocation FriendLoc, ModulePrivateLoc, ConstexprLoc, ConceptLoc; + SourceLocation FriendLoc, ModulePrivateLoc, ConstexprLoc; SourceLocation TQ_pipeLoc; WrittenBuiltinSpecs writtenBS; @@ -438,7 +436,6 @@ public: FS_noreturn_specified(false), Friend_specified(false), Constexpr_specified(false), - Concept_specified(false), Attrs(attrFactory), writtenBS(), ObjCQualifiers(nullptr) { @@ -696,8 +693,6 @@ public: unsigned &DiagID); bool SetConstexprSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID); - bool SetConceptSpec(SourceLocation Loc, const char *&PrevSpec, - unsigned &DiagID); bool isFriendSpecified() const { return Friend_specified; } SourceLocation getFriendSpecLoc() const { return FriendLoc; } @@ -708,19 +703,11 @@ public: bool isConstexprSpecified() const { return Constexpr_specified; } SourceLocation getConstexprSpecLoc() const { return ConstexprLoc; } - bool isConceptSpecified() const { return Concept_specified; } - SourceLocation getConceptSpecLoc() const { return ConceptLoc; } - void ClearConstexprSpec() { Constexpr_specified = false; ConstexprLoc = SourceLocation(); } - void ClearConceptSpec() { - Concept_specified = false; - ConceptLoc = SourceLocation(); - } - AttributePool &getAttributePool() const { return Attrs.getPool(); } @@ -2008,9 +1995,9 @@ public: case BlockContext: case ForContext: case InitStmtContext: + case ConditionContext: return true; - case ConditionContext: case MemberContext: case PrototypeContext: case TemplateParamContext: @@ -2300,6 +2287,42 @@ public: } llvm_unreachable("unknown context kind!"); } + + /// Determine whether this declaration appears in a context where an + /// expression could appear. + bool isExpressionContext() const { + switch (Context) { + case FileContext: + case KNRTypeListContext: + case MemberContext: + case TypeNameContext: // FIXME: sizeof(...) permits an expression. + case FunctionalCastContext: + case AliasDeclContext: + case AliasTemplateContext: + case PrototypeContext: + case LambdaExprParameterContext: + case ObjCParameterContext: + case ObjCResultContext: + case TemplateParamContext: + case CXXNewContext: + case CXXCatchContext: + case ObjCCatchContext: + case BlockLiteralContext: + case LambdaExprContext: + case ConversionIdContext: + case TrailingReturnContext: + return false; + + case BlockContext: + case ForContext: + case InitStmtContext: + case ConditionContext: + case TemplateTypeArgContext: + return true; + } + + llvm_unreachable("unknown context kind!"); + } /// \brief Return true if a function declarator at this position would be a /// function declaration. |