summaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-11 07:33:43 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-11 07:33:43 +0000
commit43aae69417da2f3302e53644e37526fbebaa85d6 (patch)
tree0a8efa7d178e22f6ccfca66a5e9ef32573adf206 /gcc/java/parse.y
parentb729e95f27b9163712c3fe2f4c64ebc16fce99e8 (diff)
downloadgcc-43aae69417da2f3302e53644e37526fbebaa85d6.tar.gz
2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
* lang-specs.h: Forbit the use if `-femit-class-file{s}' without `-fsyntax-only.' Fixes PR java/3248 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com> * jcf-io.c (find_class): Clarified error message. Fixes PR java/2603 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com> * parse.h (INNER_ENCLOSING_SCOPE_CHECK): No `this' is fine if the current function is static. Fixes PR java/1970 2001-07-09 Alexandre Petit-Bianco <apbianco@redhat.com> * parse.y (patch_method_invocation): Add enclosing context to ctor calls if necessary. Fixes PR java/2953 2001-07-09 Alexandre Petit-Bianco <apbianco@redhat.com> * parse.y (resolve_package): Abort if qualified expression member isn't right. (qualify_ambiguous_name): Don't qualify as type if `this' in use. Fixes PR java/1391 (http://gcc.gnu.org/ml/gcc-patches/2001-07/msg00701.html ) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43927 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index e4e682b453b..8c1806991de 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -6818,6 +6818,10 @@ resolve_package (pkg, next)
for (acc = NULL_TREE, current = EXPR_WFL_QUALIFICATION (pkg);
current; current = TREE_CHAIN (current))
{
+ /* If we don't have what we're expecting, exit now. TYPE_NAME
+ will be null and the error caught later. */
+ if (TREE_CODE (QUAL_WFL (current)) != EXPR_WITH_FILE_LOCATION)
+ break;
acc = merge_qualified_name (acc, EXPR_WFL_NODE (QUAL_WFL (current)));
if ((type_name = resolve_no_layout (acc, NULL_TREE)))
{
@@ -10120,7 +10124,9 @@ patch_method_invocation (patch, primary, where, from_super,
to have an enclosing context passed as a second parameter (the
constructor is one of an inner class. We extract it from the
current function. */
- if (is_super_init && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list)))
+ if ((is_super_init ||
+ (TREE_CODE (patch) == CALL_EXPR && name == this_identifier_node))
+ && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list)))
{
tree enclosing_decl = DECL_CONTEXT (TYPE_NAME (current_class));
tree extra_arg;
@@ -10986,9 +10992,12 @@ qualify_ambiguous_name (id)
of the compilation unit containing NAME,
- NAME is declared by exactly on type-import-on-demand declaration
of the compilation unit containing NAME.
- - NAME is actually a STRING_CST. */
- else if (TREE_CODE (name) == STRING_CST || TREE_CODE (name) == INTEGER_CST
- || (decl = resolve_and_layout (name, NULL_TREE)))
+ - NAME is actually a STRING_CST.
+ This can't happen if the expression was qualified by `this.' */
+ else if (! this_found &&
+ (TREE_CODE (name) == STRING_CST ||
+ TREE_CODE (name) == INTEGER_CST ||
+ (decl = resolve_and_layout (name, NULL_TREE))))
{
RESOLVE_TYPE_NAME_P (qual_wfl) = 1;
QUAL_RESOLUTION (qual) = decl;