This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [cxx-conversion] Support garbage-collected C++ templates
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, laurynas dot biveinis at gmail dot com, Lawrence Crowl <crowl at google dot com>
- Date: Wed, 8 Aug 2012 15:12:56 -0500
- Subject: Re: [cxx-conversion] Support garbage-collected C++ templates
- References: <20120808195258.GA30576@google.com>
hi Diego,
just a word on style in the documentation:
> +template<typename T>
> +void gt_pch_nx (TP<T> *tp)
> +@{
> + extern void gt_pch_nx (T&);
> +
> + /* This marks field 'fld' of type 'T'. */
> + gt_pch_nx (tp->fld);
> +@}
'extern' declaration at local scope if considered an extremely
poor style in C++. Furthermore, it does not interact
well with template instantiations and scope rules; plus
it does not work well when the function actually has an
internal linkage.
A proper way to bring a symbol into local scope is through
a using-declaration:
using ::gt_pch_nx;
-- Gaby