aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@markmitchell.com>1998-08-24 12:04:39 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1998-08-24 12:04:39 +0000
commitc92366fb3f2247423f12d29e9f52b5335cbda6f2 (patch)
tree99f03b642ca3975c29f50cded035be6b9bcd99b4
parent33bdeb67480c8e551270c9f93be79750c0afbebd (diff)
downloadgcc-c92366fb3f2247423f12d29e9f52b5335cbda6f2.zip
gcc-c92366fb3f2247423f12d29e9f52b5335cbda6f2.tar.gz
gcc-c92366fb3f2247423f12d29e9f52b5335cbda6f2.tar.bz2
cp-tree.h (CLASS_TYPE_P): New macro.
* cp-tree.h (CLASS_TYPE_P): New macro. * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE. From-SVN: r21945
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/cp-tree.h9
-rw-r--r--gcc/cp/decl.c2
3 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a89d657..6af7e8a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+1998-08-24 Mark Mitchell <mark@markmitchell.com>
+
+ * cp-tree.h (CLASS_TYPE_P): New macro.
+ * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE.
+
1998-08-24 Benjamin Kosnik <bkoz@cygnus.com>
* cp-tree.h: Declare.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index b73fb53..993628a 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -498,7 +498,16 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* The _DECL for this _TYPE. */
#define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
+/* Nonzero if T is a class (or struct or union) type. Also nonzero
+ for template type parameters. Despite its name, this macro has
+ nothing to do with the definition of aggregate given in the
+ standard. Think of this macro as MAYBE_CLASS_TYPE_P. */
#define IS_AGGR_TYPE(t) (TYPE_LANG_FLAG_5 (t))
+
+/* Nonzero if T is a class type. Zero for template type parameters. */
+#define CLASS_TYPE_P(t) \
+ (IS_AGGR_TYPE (t) && TREE_CODE (t) != TEMPLATE_TYPE_PARM)
+
#define IS_AGGR_TYPE_CODE(t) (t == RECORD_TYPE || t == UNION_TYPE)
#define IS_AGGR_TYPE_2(TYPE1,TYPE2) \
(TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index f232fdd..087df2f 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10444,7 +10444,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
but not both. If it appears in the class, the member is
a member constant. The file-scope definition is always
required. */
- if (IS_AGGR_TYPE (type)
+ if (CLASS_TYPE_P (type)
|| TREE_CODE (type) == REFERENCE_TYPE)
{
cp_error ("in-class initialization of static data member of non-integral type `%T'",