public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Nathan Sidwell <nathan@acm.org>
Cc: Jason Merrill <jason@redhat.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [C++] Coding rule enforcement
Date: Tue, 15 Sep 2015 13:28:00 -0000	[thread overview]
Message-ID: <CAFiYyc1yZnWf35p+w_eKXnKZOaAj9pgXufk8Ba53wH8dttJSjg@mail.gmail.com> (raw)
In-Reply-To: <55F816F2.5010209@acm.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

  reply	other threads:[~2015-09-15 13:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 13:08 Nathan Sidwell
2015-09-15 13:28 ` Richard Biener [this message]
2015-09-15 13:33   ` Nathan Sidwell
2015-09-15 13:36   ` Jason Merrill
2015-09-16 12:10     ` Nathan Sidwell
2015-09-16 14:23       ` Jason Merrill
2015-09-16 14:37         ` Nathan Sidwell
2015-09-16 16:36           ` Manuel López-Ibáñez
2015-09-16 19:34             ` Bernhard Reutner-Fischer
2015-09-17 14:56         ` Nathan Sidwell
2015-09-15 17:20   ` Manuel López-Ibáñez
2015-09-15 18:33     ` Jason Merrill
2015-09-21 13:52       ` Daniel Gutson
2015-09-21 14:02         ` Manuel López-Ibáñez
2015-09-21 16:31           ` Jason Merrill
2015-09-21 16:42             ` Daniel Gutson
2015-09-21 16:57             ` Nathan Sidwell
2015-09-21 17:19               ` Jason Merrill
2015-09-17 14:58 Ville Voutilainen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc1yZnWf35p+w_eKXnKZOaAj9pgXufk8Ba53wH8dttJSjg@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=nathan@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).