public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gdr at integrable-solutions dot net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/21837] C++/C99 standard violation in for loop Date: Tue, 31 May 2005 11:48:00 -0000 [thread overview] Message-ID: <20050531111643.26220.qmail@sourceware.org> (raw) In-Reply-To: <20050531104619.21837.ahelm@gmx.net> ------- Additional Comments From gdr at integrable-solutions dot net 2005-05-31 11:16 ------- Subject: Re: New: C++/C99 standard violation in for loop "ahelm at gmx dot net" <gcc-bugzilla@gcc.gnu.org> writes: | C++ standard quote: | | 3.3.2, paragraph 4: | Names declared in the for-init-statement, and in the condition of if, while, | for, and switch statements are local to the if, while, for, or switch statement | (including the controlled statement), and shall not be re-declared in a | subsequent condition of that statement nor in the outermost block (or, for the | if statement, any of the outermost blocks) of the controlled statement; see 6.4. | | However g++/gcc happily compiles: | | #include <stdio.h> | | int main(void) | { | for(int i=2;i<4;i++) | { | int j = i; | int i; There is duplicate of this bug in the case of C++, see PR2288. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21837
next prev parent reply other threads:[~2005-05-31 11:16 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-05-31 10:46 [Bug c++/21837] New: " ahelm at gmx dot net 2005-05-31 11:16 ` Gabriel Dos Reis 2005-05-31 11:48 ` gdr at integrable-solutions dot net [this message] 2005-05-31 12:22 ` [Bug c++/21837] " joseph at codesourcery dot com 2005-05-31 13:16 ` pinskia at gcc dot gnu dot org 2005-05-31 17:43 ` ahelm at gmx dot net
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=20050531111643.26220.qmail@sourceware.org \ --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: linkBe 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).