DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (in VAR_DECL)
STATEMENT_LIST_TRY_BLOCK (in STATEMENT_LIST)
TYPENAME_IS_RESOLVING_P (in TYPENAME_TYPE)
+ TYPE_POLYMORPHIC_P (in RECORD_TYPE and UNION_TYPE)
TARGET_EXPR_DIRECT_INIT_P (in TARGET_EXPR)
FNDECL_USED_AUTO (in FUNCTION_DECL)
DECLTYPE_FOR_LAMBDA_PROXY (in DECLTYPE_TYPE)
/* The associated LAMBDA_EXPR that made this class. */
#define CLASSTYPE_LAMBDA_EXPR(NODE) \
- (TYPE_POLYMORPHIC_P (NODE) \
+ (CLASS_TYPE_P (NODE) && TYPE_POLYMORPHIC_P (NODE) \
? NULL_TREE \
: LANG_TYPE_CLASS_CHECK (NODE)->key_method)
#define SET_CLASSTYPE_LAMBDA_EXPR(NODE, VALUE) \
A class that declares or inherits a virtual function is called a
polymorphic class. */
-#define TYPE_POLYMORPHIC_P(NODE) (TREE_LANG_FLAG_2 (NODE))
+#define TYPE_POLYMORPHIC_P(NODE) \
+ (TREE_LANG_FLAG_2 (RECORD_OR_UNION_CHECK (NODE)))
/* Nonzero if this class has a virtual function table pointer. */
#define TYPE_CONTAINS_VPTR_P(NODE) \
{
tree basetype = BINFO_TYPE (base_binfo);
- if (!TYPE_POLYMORPHIC_P (basetype))
+ if (!CLASS_TYPE_P (basetype) || !TYPE_POLYMORPHIC_P (basetype))
continue;
tree fn = look_for_overrides_here (basetype, fndecl);
gcc_assert (TYPE_PTR_P (type));
type = TREE_TYPE (type);
- if (!TYPE_POLYMORPHIC_P (type))
+ if (!CLASS_TYPE_P (type) || !TYPE_POLYMORPHIC_P (type))
return exp;
/* We use this a couple of times below, protect it. */
return error_mark_node;
/* If exp is a reference to polymorphic type, get the real type_info. */
- if (TYPE_POLYMORPHIC_P (type) && ! resolves_to_fixed_type_p (exp, 0))
+ if (CLASS_TYPE_P (type)
+ && TYPE_POLYMORPHIC_P (type)
+ && ! resolves_to_fixed_type_p (exp, 0))
{
/* build reference to type_info from vtable. */
tree index;
if (processing_template_decl)
return build_min (TYPEID_EXPR, const_type_info_type_node, exp);
- if (TYPE_POLYMORPHIC_P (TREE_TYPE (exp))
+ if (CLASS_TYPE_P (TREE_TYPE (exp))
+ && TYPE_POLYMORPHIC_P (TREE_TYPE (exp))
&& ! resolves_to_fixed_type_p (exp, &nonnull)
&& ! nonnull)
{