OSDN Git Service

* decl.c (define_case_label): Don't crash if we're not in a switch.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Sep 1999 19:16:37 +0000 (19:16 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Sep 1999 19:16:37 +0000 (19:16 +0000)
* decl2.c (lang_decode_option): Don't bother explicitly ignoring flags.
* lang-options.h: Restore -fthis-is-variable.  Remove help strings
for unsupported flags.
* decl2.c (lang_decode_option): Accept and ignore -finit-priority.
Accept and warn about -fthis-is-variable.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29594 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/lang-options.h

index d7b70c6..25f9057 100644 (file)
@@ -1,3 +1,11 @@
+1999-09-22  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl.c (define_case_label): Don't crash if we're not in a switch.
+
+       * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags.
+       * lang-options.h: Restore -fthis-is-variable.  Remove help strings
+       for unsupported flags.
+
 1999-09-21  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl2.c (lang_decode_option): Accept and ignore -finit-priority.
index 4371372..a6706b5 100644 (file)
@@ -4879,8 +4879,8 @@ pop_switch ()
   switch_stack = switch_stack->next;
 }
 
-/* Same, but for CASE labels.  If DECL is NULL_TREE, it's the default.  */
-/* XXX Note decl is never actually used. (bpk) */
+/* Note that we've seen a definition of a case label, and complain if this
+   is a bad place for one.  */
 
 void
 define_case_label ()
@@ -4889,6 +4889,10 @@ define_case_label ()
   struct binding_level *b = current_binding_level;
   int identified = 0;
 
+  if (! switch_stack)
+    /* Don't crash; we'll complain in do_case.  */
+    return;
+  
   if (cleanup)
     {
       static int explained = 0;
index a348fe8..262d6a1 100644 (file)
@@ -567,25 +567,10 @@ lang_decode_option (argc, argv)
       if (!strcmp (p, "handle-exceptions")
          || !strcmp (p, "no-handle-exceptions"))
        warning ("-fhandle-exceptions has been renamed to -fexceptions (and is now on by default)");
-
-      if (!strcmp (p, "memoize-lookups")
-         || !strcmp (p, "no-memoize-lookups")
-         || !strcmp (p, "save-memoized")
-         || !strcmp (p, "no-save-memoized")
-         || !strcmp (p, "no-all-virtual")
-         || !strcmp (p, "no-enum-int-equiv")
-         || !strcmp (p, "init-priority")
-         || !strcmp (p, "no-init-priority")
-         || !strcmp (p, "nonnull-objects")
-         || !strcmp (p, "no-this-is-variable")
-          || !strcmp (p, "ansi-overloading"))
-       /* ignore */
-       ;
       else if (!strcmp (p, "all-virtual")
               || !strcmp (p, "enum-int-equiv")
               || !strcmp (p, "no-nonnull-objects")
-              || !strcmp (p, "this-is-variable")
-              || !strcmp (p, "no-ansi-overloading"))
+              || !strcmp (p, "this-is-variable"))
        warning ("-f%s is no longer supported", p);
       else if (! strcmp (p, "alt-external-templates"))
        {
index f5bf2bb..4b743c0 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for switches for C++.
-   Copyright (C) 1995, 96-97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995, 96-98, 1999 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -25,7 +25,7 @@ DEFINE_LANG_NAME ("C++")
 
   { "-faccess-control", "" },
   { "-fno-access-control", "Do not obey access control semantics" },
-  { "-fall-virtual", "Make all member functions virtual" },
+  { "-fall-virtual", "" },
   { "-fno-all-virtual", "" },
   { "-falt-external-templates", "Change when template instances are emitted" },
   { "-fno-alt-external-templates", "" },
@@ -66,7 +66,7 @@ DEFINE_LANG_NAME ("C++")
   { "-fno-implicit-templates", "Only emit explicit template instatiations" },
   { "-fimplicit-inline-templates", "" },
   { "-fno-implicit-inline-templates", "Only emit explicit instatiations of inline templates" },
-  { "-finit-priority", "Handle the init_priority attribute" },
+  { "-finit-priority", "" },
   { "-fno-init-priority", "" },
   { "-flabels-ok", "Labels can be used as first class objects" },
   { "-fno-labels-ok", "" },
@@ -78,7 +78,7 @@ DEFINE_LANG_NAME ("C++")
   { "-fnew-abi", "Enable experimental ABI changes" },
   { "-fno-new-abi", "" },
   { "-fnonnull-objects", "" },
-  { "-fno-nonnull-objects", "Do not assume that a reference is always valid" },
+  { "-fno-nonnull-objects", "" },
   { "-foperator-names", "Recognise and/bitand/bitor/compl/not/or/xor" },
   { "-fno-operator-names", "" },
   { "-foptional-diags", "" },
@@ -96,6 +96,8 @@ DEFINE_LANG_NAME ("C++")
   { "-fstrict-prototype", "" },
   { "-fno-strict-prototype", "Do not assume that empty prototype means no args" },
   { "-ftemplate-depth-", "Specify maximum template instantiation depth"},
+  { "-fthis-is-variable", "Make 'this' not be type '* const'"  },
+  { "-fno-this-is-variable", "" },
   { "-fvtable-gc", "Discard unused virtual functions" },
   { "-fno-vtable-gc", "" },
   { "-fvtable-thunks", "Implement vtables using thunks" },