On Tue, Sep 15, 2015 at 3:02 PM, Nathan Sidwell <nat...@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