This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR c++/25854: Bogus diagnostic with '<type error>'
- From: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- To: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 19 Jan 2006 07:09:24 -0600
- Subject: Re: [patch] Fix PR c++/25854: Bogus diagnostic with '<type error>'
- References: <tkrat.ec312714a27bcbf2@igpm.rwth-aachen.de>
Volker Reichelt <reichelt@igpm.rwth-aachen.de> writes:
| For the testcase
|
| template<typename> struct A {};
| template<> struct A<> {};
|
| we issue the following diagnostic:
|
| diag.cc:2: error: wrong number of template arguments (0, should be 1)
| diag.cc:1: error: provided for 'template<class> struct A'
| diag.cc:2: error: explicit specialization of non-template '<type error>'
|
| The third line (which wasn't emitted before GCC 3.4.0) is clearly bogus.
| This happens because we pass an error_mark_node as argument to
| maybe_process_partial_specialization, which cannot do anything
| useful with this input and gives this bogus diagnostic.
|
| The fix is to return early on such input.
|
| Bootstrapped and regtested on x86_64-unknown-linux-gnu.
| Ok for mainline, 4.1 branch, 4.0 branch, and 3.4 branch?
Yes.
-- Gaby