This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] Coding rule enforcement
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Nathan Sidwell <nathan at acm dot org>
- Cc: Jason Merrill <jason at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 15 Sep 2015 15:26:28 +0200
- Subject: Re: [C++] Coding rule enforcement
- Authentication-results: sourceware.org; auth=none
- References: <55F816F2 dot 5010209 at acm dot org>
On Tue, Sep 15, 2015 at 3:02 PM, Nathan Sidwell <nathan@acm.org> wrote:
> Jason,
> somme of our customers have 'interesting' C++ coding rules, they'd like to
> have the compiler enforced. They want to disable:
>
> 1) namespace definitions
> 2) template declarations
> 3) multiple inheritance
> 4) virtual inheritance
>
> But they want to use the STL. This patch implements 4 new flags, intended
> to be use in the -fno-FOO form. They're only active outside of system
> header files.
>
> 1) -fno-namespaces disables namespace definitions, but not using directives
> or qualified names.
>
> 2) -fno-templates disables primary template declarations, but not template
> instantiations or specializations (partial or otherwise).
>
> 3) -fno-multiple-inheritance disables direct multiple inheritance, but not
> indirect multiple inheritance
>
> 4) -fno-virtual-inheritance disables direct virtual inheritance, but not
> indirect virtual inheritance.
Wouldn't warning flags be better so you can decide whether it's an error
or a warning via -Werror=virtual-inheritance vs. -Wvirtual-inheritance?
> Thus you can't use any of these features directly, but one can use the STL
> and have it behave as intended.
>
> WDYT?
>
> nathan