This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix PR c++/25854: Bogus diagnostic with '<type error>'


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]