]> git.saurik.com Git - bison.git/commitdiff
(parse_union_decl): Define YYSTYPE_IS_TRIVIAL if we use our YYSTYPE.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Mar 2002 21:53:05 +0000 (21:53 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Mar 2002 21:53:05 +0000 (21:53 +0000)
It must be trivial, or our own union wouldn't be valid C++ anyway.
(readgram): Define YYSTYPE_IS_TRIVIAL if it is int.
(reader_output_yylsp): Define YYLTYPE_IS_TRIVIAL if we use our YYLTYPE.

src/reader.c

index 0d9508026d5af5300216440ea4b96fb887c90b71..de16d91bfb5a88959b9fbf5e0351c26f071c495a 100644 (file)
@@ -745,6 +745,7 @@ typedef union";
   const char *epilogue = "\
  yystype;\n\
 # define YYSTYPE yystype\n\
+# define YYSTYPE_IS_TRIVIAL 1\n\
 #endif\n";
 
   if (typed)
@@ -1617,12 +1618,16 @@ readgram (void)
       /* We used to use `unsigned long' as YYSTYPE on MSDOS,
          but it seems better to be consistent.
          Most programs should declare their own type anyway.  */
-      obstack_sgrow (&attrs_obstack,
-                          "#ifndef YYSTYPE\n#define YYSTYPE int\n#endif\n");
+      obstack_sgrow (&attrs_obstack, "\
+#ifndef YYSTYPE\n\
+# define YYSTYPE int\n\
+# define YYSTYPE_IS_TRIVIAL 1\n\
+#endif\n");
       if (defines_flag)
        obstack_sgrow (&defines_obstack, "\
 # ifndef YYSTYPE\n\
 #  define YYSTYPE int\n\
+#  define YYSTYPE_IS_TRIVIAL 1\n\
 # endif\n");
     }
 
@@ -2043,6 +2048,7 @@ typedef struct yyltype\n\
 } yyltype;\n\
 \n\
 # define YYLTYPE yyltype\n\
+# define YYLTYPE_IS_TRIVIAL 1\n\
 #endif\n\
 \n");
 }