diff --git a/gcc/java/parse.c b/gcc/java/parse.c index a01cb65f118..42d46998521 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -9996,7 +9996,8 @@ java_complete_expand_methods (class_decl) for (decl = first_decl; decl; decl = TREE_CHAIN (decl)) { /* Skip abstract or native methods */ - if (METHOD_ABSTRACT (decl) || METHOD_NATIVE (decl)) + if (METHOD_ABSTRACT (decl) || METHOD_NATIVE (decl) + || DECL_CONSTRUCTOR_P (decl) || DECL_CLINIT_P (decl)) continue; java_complete_expand_method (decl); } diff --git a/gcc/java/parse.y b/gcc/java/parse.y index f56daab8a95..427ba7544a2 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -7298,7 +7298,8 @@ java_complete_expand_methods (class_decl) for (decl = first_decl; decl; decl = TREE_CHAIN (decl)) { /* Skip abstract or native methods */ - if (METHOD_ABSTRACT (decl) || METHOD_NATIVE (decl)) + if (METHOD_ABSTRACT (decl) || METHOD_NATIVE (decl) + || DECL_CONSTRUCTOR_P (decl) || DECL_CLINIT_P (decl)) continue; java_complete_expand_method (decl); }