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: [C++ PATCH] Fix check_explicit_specialization (PR c++/32596, regression caused by PR c++/31923)


Jakub Jelinek wrote:
The following patch copies just DECL_INTERFACE_KNOWN which is enough to fix
this bug and didn't cause any make check-g++ or make check-libstdc++-v3
failure, but I wonder if we shouldn't copy DECL_NOT_REALLY_EXTERN as well,
or if DECL_INTERFACE_KNOWN can be copied over unconditionally.

+	      if (! TREE_PUBLIC (decl) && DECL_INTERFACE_KNOWN (tmpl_func))
+		DECL_INTERFACE_KNOWN (decl) = 1;

The right fix is to do what grokfndecl does: if !TREE_PUBLIC, set DECL_INTERFACE_KNOWN and DECL_NOT_REALLY_EXTERN. No need to check DECL_INTERFACE_KNOWN on the template.


Incidentally, it seems wrong to me to be propagating DECL_VISIBILITY here, since a specialization can have less visibility than its template.

Jason


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