aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@redhat.com>2001-07-13 12:43:54 -0700
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2001-07-13 12:43:54 -0700
commitb6e3e1ff580c11f8d95930f12560824471521175 (patch)
tree1a2ea0dfc79181825aa29dc546dfd81b7294ee46 /gcc
parent48ccfb4086add7f319242fe6c2ec178788dd278f (diff)
downloadgcc-b6e3e1ff580c11f8d95930f12560824471521175.zip
gcc-b6e3e1ff580c11f8d95930f12560824471521175.tar.gz
gcc-b6e3e1ff580c11f8d95930f12560824471521175.tar.bz2
re PR java/3635 ("empty declaration" warning too broad)
2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com> * parse.y (patch_method_invocation): Don't override primary if one is already provided, but let this$<n> be built. Fixed comment. 2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com> * parse.y (empty_statement:): Report empty statement error only when found at class declaration level. Fixes PR java/3635 (http://gcc.gnu.org/ml/gcc-patches/2001-07/msg00885.html ) From-SVN: r43993
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog11
-rw-r--r--gcc/java/parse.y13
2 files changed, 21 insertions, 3 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 4648f54..6301515 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,14 @@
+2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (patch_method_invocation): Don't override primary if one
+ is already provided, but let this$<n> be built. Fixed comment.
+
+2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (empty_statement:): Report empty statement error only
+ when found at class declaration level.
+ Fixes PR java/3635
+
2001-07-12 Tom Tromey <tromey@redhat.com>
* expr.c (expand_load_internal): New function.
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index b5cdbdb..03a540c 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -1453,7 +1453,13 @@ statement_without_trailing_substatement:
empty_statement:
SC_TK
{
- if (flag_extraneous_semicolon)
+ if (flag_extraneous_semicolon
+ && ! current_static_block
+ && (! current_function_decl ||
+ /* Verify we're not in a inner class declaration */
+ (GET_CPC () != TYPE_NAME
+ (DECL_CONTEXT (current_function_decl)))))
+
{
EXPR_WFL_SET_LINECOL (wfl_operator, lineno, -1);
parse_warning_context (wfl_operator, "An empty declaration is a deprecated feature that should not be used");
@@ -10030,7 +10036,7 @@ patch_method_invocation (patch, primary, where, from_super,
- LIST is non static. It's invocation is transformed from
x(a1,....,an) into access$<n>(this$<n>,a1,...,an).
- LIST is static. It's invocation is transformed from
- x(a1,....,an) into TYPEOF(this$<n>).x(a1,....an).
+ x(a1,....,an) into TYPE_OF(this$<n>).x(a1,....an).
Of course, this$<n> can be abitrary complex, ranging from
this$0 (the immediate outer context) to
@@ -10040,7 +10046,8 @@ patch_method_invocation (patch, primary, where, from_super,
this_arg has to be moved into the (then generated) stub
argument list. In the meantime, the selected function
might have be replaced by a generated stub. */
- if (maybe_use_access_method (is_super_init, &list, &this_arg))
+ if (!primary &&
+ maybe_use_access_method (is_super_init, &list, &this_arg))
{
args = tree_cons (NULL_TREE, this_arg, args);
this_arg = NULL_TREE; /* So it doesn't get chained twice */