diff options
Diffstat (limited to 'include/clang/AST/Expr.h')
-rw-r--r-- | include/clang/AST/Expr.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 36d70d8..4ff1257 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -427,12 +427,24 @@ private: public: + /// \brief Returns true if this expression is a gl-value that + /// potentially refers to a bit-field. + /// + /// In C++, whether a gl-value refers to a bitfield is essentially + /// an aspect of the value-kind type system. + bool refersToBitField() const { return getObjectKind() == OK_BitField; } + /// \brief If this expression refers to a bit-field, retrieve the /// declaration of that bit-field. - FieldDecl *getBitField(); + /// + /// Note that this returns a non-null pointer in subtly different + /// places than refersToBitField returns true. In particular, this can + /// return a non-null pointer even for r-values loaded from + /// bit-fields, but it will return null for a conditional bit-field. + FieldDecl *getSourceBitField(); - const FieldDecl *getBitField() const { - return const_cast<Expr*>(this)->getBitField(); + const FieldDecl *getSourceBitField() const { + return const_cast<Expr*>(this)->getSourceBitField(); } /// \brief If this expression is an l-value for an Objective C @@ -2644,7 +2656,7 @@ protected: (ty->isInstantiationDependentType() || (op && op->isInstantiationDependent())), (ty->containsUnexpandedParameterPack() || - op->containsUnexpandedParameterPack())), + (op && op->containsUnexpandedParameterPack()))), Op(op) { assert(kind != CK_Invalid && "creating cast with invalid cast kind"); CastExprBits.Kind = kind; |