cp-tree.h (CLASS_TYPE_P): New macro.
authorMark Mitchell <mark@markmitchell.com>
Mon, 24 Aug 1998 12:04:39 +0000 (12:04 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 24 Aug 1998 12:04:39 +0000 (12:04 +0000)
* cp-tree.h (CLASS_TYPE_P): New macro.
* decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE.

From-SVN: r21945

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c

index a89d657a9ba4246f0d379600fac86727d1268a6c..6af7e8a285d9620130fa05b60d92f701a524f3be 100644 (file)
@@ -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.
index b73fb535484df3f597295b1483465aeda798a556..993628a4296d6ee61eca0c51e19ed1f20504f602 100644 (file)
@@ -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)      \
index f232fdd4d737f19501b560f21da182f9bb6297ac..087df2fa93421098775bedfe4adef8c5092ba04f 100644 (file)
@@ -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'",