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]

[C++ PATCH] [PR18733] Fix specializations in friend declarations


Hello,

it looks like that when I enforced the checks for missing specialization
template headers back in July:

2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>

        PR c++/14497
        * pt.c (check_explicit_specialization): Remove extension to accept
        specializations without template headers. Fall-through to normal
        processing.

I managed to expose a bug that shows that we do not currently handle
correctly specializations in friend declarations. The rules for friend
declarations are surely easier: you can name any (full) specialization with
template headers at all. So, current_tmpl_spec_kind does not apply for
friend functions. My patch now avoids to call it in
check_explicit_specialization.

Tested on i686-pc-linux-gnu with no new regressions, OK for mainline?

Giovanni Bajo



cp/
        * pt.c (check_explicit_specialization): Use special logic to
validate
        befriended specializations.


testsuite/
        * g++.dg/template/friend32.C: New testcase.

Attachment: patch-pr18733.txt
Description: Text document


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