public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/85487] Support '#pragma region' and '#pragma endregion' to allow code folding with Visual Studio
Date: Tue, 15 Feb 2022 15:23:36 +0000	[thread overview]
Message-ID: <bug-85487-4-xYTC7DLJ30@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-85487-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85487

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> Exactly.  Seems clang doesn't bother with it and allows anything, but it is
> unclear if that is the best thing to do.

MSVC ignores any tokens after the region/endregion as well.

> Is name and comment just a single identifier, or any sequence of any tokens
> until end of line?
> And, shall the compiler verify proper nestin of these, e.g. reject
> #pragma endregion
> without earlier #pragma region, or
> #pragma region
> without termination, or whenever they aren't properly nested?

Again, other compilers don't care:
https://godbolt.org/z/zxhYaaz9Y

So it looks like this is completely ignored by the compiler, and any logic
relating to it exists only in the editor(s).

  parent reply	other threads:[~2022-02-15 15:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-85487-4@http.gcc.gnu.org/bugzilla/>
2020-08-27 20:46 ` bmburstein at gmail dot com
2022-02-15 13:17 ` redi at gcc dot gnu.org
2022-02-15 13:31 ` jakub at gcc dot gnu.org
2022-02-15 14:02 ` austinpmorton at gmail dot com
2022-02-15 15:23 ` redi at gcc dot gnu.org [this message]
2022-02-15 15:26 ` jakub at gcc dot gnu.org
2022-02-15 15:32 ` redi at gcc dot gnu.org
2022-02-15 15:34 ` redi at gcc dot gnu.org
2022-02-17 11:45 ` egallager at gcc dot gnu.org
2022-02-21 17:11 ` fw at gcc dot gnu.org
2022-02-25 13:01 ` rsandifo at gcc dot gnu.org
2022-02-25 14:46 ` redi at gcc dot gnu.org
2022-02-25 14:49 ` redi at gcc dot gnu.org
2022-05-30 15:43 ` bmburstein at gmail dot com
2022-11-11  4:28 ` cvs-commit at gcc dot gnu.org
2022-11-11  4:28 ` redi at gcc dot gnu.org

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=bug-85487-4-xYTC7DLJ30@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).