From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23655 invoked by alias); 12 Apr 2011 17:14:26 -0000 Received: (qmail 23647 invoked by uid 22791); 12 Apr 2011 17:14:24 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Apr 2011 17:14:19 +0000 From: "jobnoorman at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/48578] New: Range-based for-loops do not compile when -nostdinc is given X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jobnoorman at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Tue, 12 Apr 2011 17:14:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg01248.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D48578 Summary: Range-based for-loops do not compile when -nostdinc is given Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: jobnoorman@gmail.com Created attachment 23965 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D23965 Simple file which produces the error When using range-based for-loops when -nostdinc is given, GCC gives an error about 'begin' and 'end' not being declared while they definitely are. I've attached a simple file which produces this error. Here's the output of "g++ -v -save-temps -std=3Dc++0x -nostdinc main.cpp": Using built-in specs. COLLECT_GCC=3D/usr/local/bin/g++ COLLECT_LTO_WRAPPER=3D/usr/local/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wr= apper Target: i686-pc-linux-gnu Configured with: ./configure --enable-languages=3Dc,c++ Thread model: posix gcc version 4.6.0 (GCC)=20 COLLECT_GCC_OPTIONS=3D'-v' '-save-temps' '-std=3Dc++0x' '-nostdinc' '-shared-libgcc' '-mtune=3Dgeneric' '-march=3Dpentiumpro' /usr/local/libexec/gcc/i686-pc-linux-gnu/4.6.0/cc1plus -E -quiet -nostdinc= -v -D_GNU_SOURCE main.cpp -mtune=3Dgeneric -march=3Dpentiumpro -std=3Dc++0x -fpch-preprocess -o main.ii #include "..." search starts here: #include <...> search starts here: End of search list. COLLECT_GCC_OPTIONS=3D'-v' '-save-temps' '-std=3Dc++0x' '-nostdinc' '-shared-libgcc' '-mtune=3Dgeneric' '-march=3Dpentiumpro' /usr/local/libexec/gcc/i686-pc-linux-gnu/4.6.0/cc1plus -fpreprocessed main= .ii -quiet -dumpbase main.cpp -mtune=3Dgeneric -march=3Dpentiumpro -auxbase main -std=3Dc++0x -version -o main.s GNU C++ (GCC) version 4.6.0 (i686-pc-linux-gnu) compiled by GNU C version 4.6.0, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9 GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 GNU C++ (GCC) version 4.6.0 (i686-pc-linux-gnu) compiled by GNU C version 4.6.0, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9 GGC heuristics: --param ggc-min-expand=3D100 --param ggc-min-heapsize=3D131= 072 Compiler executable checksum: 07532dd28c9f528a39c397b207537ed2 main.cpp: In function =E2=80=98int main()=E2=80=99: main.cpp:11:18: error: =E2=80=98begin=E2=80=99 was not declared in this sco= pe main.cpp:11:18: error: =E2=80=98end=E2=80=99 was not declared in this scope