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++] Coding rule enforcement


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


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