Commit b0a1da19 by Jason Merrill Committed by Jason Merrill

decl.c (define_case_label): Don't crash if we're not in a switch.

	* 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.
	* decl2.c (lang_decode_option): Accept and ignore -finit-priority.
	Accept and warn about -fthis-is-variable.

From-SVN: r29594
parent bad1e2ac
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> 1999-09-21 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (lang_decode_option): Accept and ignore -finit-priority. * decl2.c (lang_decode_option): Accept and ignore -finit-priority.
......
...@@ -4879,8 +4879,8 @@ pop_switch () ...@@ -4879,8 +4879,8 @@ pop_switch ()
switch_stack = switch_stack->next; switch_stack = switch_stack->next;
} }
/* Same, but for CASE labels. If DECL is NULL_TREE, it's the default. */ /* Note that we've seen a definition of a case label, and complain if this
/* XXX Note decl is never actually used. (bpk) */ is a bad place for one. */
void void
define_case_label () define_case_label ()
...@@ -4889,6 +4889,10 @@ define_case_label () ...@@ -4889,6 +4889,10 @@ define_case_label ()
struct binding_level *b = current_binding_level; struct binding_level *b = current_binding_level;
int identified = 0; int identified = 0;
if (! switch_stack)
/* Don't crash; we'll complain in do_case. */
return;
if (cleanup) if (cleanup)
{ {
static int explained = 0; static int explained = 0;
......
...@@ -567,25 +567,10 @@ lang_decode_option (argc, argv) ...@@ -567,25 +567,10 @@ lang_decode_option (argc, argv)
if (!strcmp (p, "handle-exceptions") if (!strcmp (p, "handle-exceptions")
|| !strcmp (p, "no-handle-exceptions")) || !strcmp (p, "no-handle-exceptions"))
warning ("-fhandle-exceptions has been renamed to -fexceptions (and is now on by default)"); 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") else if (!strcmp (p, "all-virtual")
|| !strcmp (p, "enum-int-equiv") || !strcmp (p, "enum-int-equiv")
|| !strcmp (p, "no-nonnull-objects") || !strcmp (p, "no-nonnull-objects")
|| !strcmp (p, "this-is-variable") || !strcmp (p, "this-is-variable"))
|| !strcmp (p, "no-ansi-overloading"))
warning ("-f%s is no longer supported", p); warning ("-f%s is no longer supported", p);
else if (! strcmp (p, "alt-external-templates")) else if (! strcmp (p, "alt-external-templates"))
{ {
......
/* Definitions for switches for C++. /* 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. This file is part of GNU CC.
...@@ -25,7 +25,7 @@ DEFINE_LANG_NAME ("C++") ...@@ -25,7 +25,7 @@ DEFINE_LANG_NAME ("C++")
{ "-faccess-control", "" }, { "-faccess-control", "" },
{ "-fno-access-control", "Do not obey access control semantics" }, { "-fno-access-control", "Do not obey access control semantics" },
{ "-fall-virtual", "Make all member functions virtual" }, { "-fall-virtual", "" },
{ "-fno-all-virtual", "" }, { "-fno-all-virtual", "" },
{ "-falt-external-templates", "Change when template instances are emitted" }, { "-falt-external-templates", "Change when template instances are emitted" },
{ "-fno-alt-external-templates", "" }, { "-fno-alt-external-templates", "" },
...@@ -66,7 +66,7 @@ DEFINE_LANG_NAME ("C++") ...@@ -66,7 +66,7 @@ DEFINE_LANG_NAME ("C++")
{ "-fno-implicit-templates", "Only emit explicit template instatiations" }, { "-fno-implicit-templates", "Only emit explicit template instatiations" },
{ "-fimplicit-inline-templates", "" }, { "-fimplicit-inline-templates", "" },
{ "-fno-implicit-inline-templates", "Only emit explicit instatiations of 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", "" }, { "-fno-init-priority", "" },
{ "-flabels-ok", "Labels can be used as first class objects" }, { "-flabels-ok", "Labels can be used as first class objects" },
{ "-fno-labels-ok", "" }, { "-fno-labels-ok", "" },
...@@ -78,7 +78,7 @@ DEFINE_LANG_NAME ("C++") ...@@ -78,7 +78,7 @@ DEFINE_LANG_NAME ("C++")
{ "-fnew-abi", "Enable experimental ABI changes" }, { "-fnew-abi", "Enable experimental ABI changes" },
{ "-fno-new-abi", "" }, { "-fno-new-abi", "" },
{ "-fnonnull-objects", "" }, { "-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" }, { "-foperator-names", "Recognise and/bitand/bitor/compl/not/or/xor" },
{ "-fno-operator-names", "" }, { "-fno-operator-names", "" },
{ "-foptional-diags", "" }, { "-foptional-diags", "" },
...@@ -96,6 +96,8 @@ DEFINE_LANG_NAME ("C++") ...@@ -96,6 +96,8 @@ DEFINE_LANG_NAME ("C++")
{ "-fstrict-prototype", "" }, { "-fstrict-prototype", "" },
{ "-fno-strict-prototype", "Do not assume that empty prototype means no args" }, { "-fno-strict-prototype", "Do not assume that empty prototype means no args" },
{ "-ftemplate-depth-", "Specify maximum template instantiation depth"}, { "-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" }, { "-fvtable-gc", "Discard unused virtual functions" },
{ "-fno-vtable-gc", "" }, { "-fno-vtable-gc", "" },
{ "-fvtable-thunks", "Implement vtables using thunks" }, { "-fvtable-thunks", "Implement vtables using thunks" },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment