aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@cs.tamu.edu>2010-10-27 15:04:06 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-10-27 15:04:06 -0400
commit3b49d762b5d6845f6c09926a0a6b2d5e0471a755 (patch)
tree20c0a5070bcb65304f258d5cd324f9c98af07721 /gcc/cp/cp-tree.h
parent61f8d16512a62120c29e1cc82cddbc4d3816a1c4 (diff)
downloadgcc-3b49d762b5d6845f6c09926a0a6b2d5e0471a755.zip
gcc-3b49d762b5d6845f6c09926a0a6b2d5e0471a755.tar.gz
gcc-3b49d762b5d6845f6c09926a0a6b2d5e0471a755.tar.bz2
class.c (check_bases): Propagate non-literality.
* class.c (check_bases): Propagate non-literality. (check_field_decls): Likewise. (finalize_literal_type_property): New. (check_bases_and_members): Call it. * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New. (lang_type_class): Add has_constexpr_ctor field. (DECL_DECLARED_CONSTEXPR_P): Strip template. * decl.c (grok_special_member_properties): Set TYPE_HAS_CONSTEXPR_CTOR. Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r166012
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index ec026a4..8c0c9b1 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1324,6 +1324,7 @@ struct GTY(()) lang_type_class {
unsigned lazy_move_assign : 1;
unsigned has_complex_move_ctor : 1;
unsigned has_complex_move_assign : 1;
+ unsigned has_constexpr_ctor : 1;
/* When adding a flag here, consider whether or not it ought to
apply to a template instance if it applies to the template. If
@@ -1332,7 +1333,7 @@ struct GTY(()) lang_type_class {
/* There are some bits left to fill out a 32-bit word. Keep track
of this by updating the size of this bitfield whenever you add or
remove a flag. */
- unsigned dummy : 4;
+ unsigned dummy : 3;
tree primary_base;
VEC(tree_pair_s,gc) *vcall_indices;
@@ -1457,6 +1458,12 @@ struct GTY((variable_size)) lang_type {
#define TYPE_HAS_LIST_CTOR(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->has_list_ctor)
+/* Nonzero if this class has a constexpr constructor other than a copy/move
+ constructor. Note that a class can have constexpr constructors for
+ static initialization even if it isn't a literal class. */
+#define TYPE_HAS_CONSTEXPR_CTOR(NODE) \
+ (LANG_TYPE_CLASS_CHECK (NODE)->has_constexpr_ctor)
+
/* Nonzero if this class defines an overloaded operator new. (An
operator new [] doesn't count.) */
#define TYPE_HAS_NEW_OPERATOR(NODE) \
@@ -2334,7 +2341,7 @@ struct GTY((variable_size)) lang_decl {
/* True if DECL is declared 'constexpr'. */
#define DECL_DECLARED_CONSTEXPR_P(DECL) \
- DECL_LANG_FLAG_8 (VAR_OR_FUNCTION_DECL_CHECK (DECL))
+ DECL_LANG_FLAG_8 (VAR_OR_FUNCTION_DECL_CHECK (STRIP_TEMPLATE (DECL)))
/* Nonzero if this DECL is the __PRETTY_FUNCTION__ variable in a
template function. */