diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1999-02-15 23:45:02 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-02-15 18:45:02 -0500 |
commit | 20496fa2c8810a2da8d3667e35616999ab6fd8d9 (patch) | |
tree | 23ec512cf391be32febb9e770eaf9081e12d8415 /gcc | |
parent | 0c63f729edf63919459d05a4bdf65b6b30cf0b0f (diff) | |
download | gcc-20496fa2c8810a2da8d3667e35616999ab6fd8d9.zip gcc-20496fa2c8810a2da8d3667e35616999ab6fd8d9.tar.gz gcc-20496fa2c8810a2da8d3667e35616999ab6fd8d9.tar.bz2 |
decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node.
* decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node.
(grokdeclarator): Don't expect error_mark_node from grokfndecl.
* pt.c (maybe_process_partial_specialization): Complain about
'template <>' on non-specialization.
From-SVN: r25225
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/decl.c | 17 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 |
3 files changed, 16 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dd1612d..8fb2e88 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +1999-02-13 Jason Merrill <jason@yorick.cygnus.com> + + * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node. + (grokdeclarator): Don't expect error_mark_node from grokfndecl. + + * pt.c (maybe_process_partial_specialization): Complain about + 'template <>' on non-specialization. + 1999-02-10 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Catch wierd declarators. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 2547ddf..24dbfd1 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8344,7 +8344,7 @@ bad_specifiers (object, type, virtualp, quals, inlinep, friendp, raises) CHECK is 1 if we must find this method in CTYPE, 0 if we should not look, and -1 if we should not call `grokclassfn' at all. - Returns `error_mark_node' if something goes wrong, after issuing + Returns `NULL_TREE' if something goes wrong, after issuing applicable error messages. */ static tree @@ -8496,7 +8496,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, /* Something like `template <class T> friend void f<T>()'. */ cp_error ("template-id `%D' in declaration of primary template", orig_declarator); - return error_mark_node; + return NULL_TREE; } /* A friend declaration of the form friend void f<>(). Record @@ -8544,7 +8544,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, 2 * (funcdef_flag != 0) + 4 * (friendp != 0)); if (decl == error_mark_node) - return error_mark_node; + return NULL_TREE; if ((! TYPE_FOR_JAVA (ctype) || check_java_method (decl)) && check) @@ -8560,7 +8560,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, return tmp; } if (! grok_ctor_properties (ctype, decl)) - return error_mark_node; + return NULL_TREE; } else { @@ -8577,7 +8577,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, 2 * (funcdef_flag != 0) + 4 * (friendp != 0)); if (decl == error_mark_node) - return error_mark_node; + return NULL_TREE; if (ctype != NULL_TREE && (! TYPE_FOR_JAVA (ctype) || check_java_method (decl)) @@ -10931,7 +10931,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) virtualp, flags, quals, raises, attrlist, friendp ? -1 : 0, friendp, publicp, inlinep, funcdef_flag, template_count, in_namespace); - if (decl == NULL_TREE || decl == error_mark_node) + if (decl == NULL_TREE) return decl; #if 0 /* This clobbers the attrs stored in `decl' from `attrlist'. */ @@ -11178,11 +11178,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) if (decl == NULL_TREE) return NULL_TREE; - /* Among other times, could occur from check_explicit_specialization - returning an error_mark_node. */ - if (decl == error_mark_node) - return error_mark_node; - if (staticp == 1) { int illegal_static = 0; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2af40a8..184832c 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -688,6 +688,8 @@ maybe_process_partial_specialization (type) else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type)) cp_error ("specialization of `%T' after instantiation", type); } + else if (processing_specialization) + cp_error ("explicit specialization of non-template `%T'", type); } /* Retrieve the specialization (in the sense of [temp.spec] - a |