public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48578] New: Range-based for-loops do not compile when -nostdinc is given
@ 2011-04-12 17:14 jobnoorman at gmail dot com
2011-04-12 17:39 ` [Bug c++/48578] " redi at gcc dot gnu.org
2011-04-12 18:29 ` jobnoorman at gmail dot com
0 siblings, 2 replies; 3+ messages in thread
From: jobnoorman at gmail dot com @ 2011-04-12 17:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48578
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=23965
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=c++0x -nostdinc main.cpp":
Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ./configure --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-nostdinc'
'-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
/usr/local/libexec/gcc/i686-pc-linux-gnu/4.6.0/cc1plus -E -quiet -nostdinc -v
-D_GNU_SOURCE main.cpp -mtune=generic -march=pentiumpro -std=c++0x
-fpch-preprocess -o main.ii
#include "..." search starts here:
#include <...> search starts here:
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-nostdinc'
'-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
/usr/local/libexec/gcc/i686-pc-linux-gnu/4.6.0/cc1plus -fpreprocessed main.ii
-quiet -dumpbase main.cpp -mtune=generic -march=pentiumpro -auxbase main
-std=c++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=100 --param ggc-min-heapsize=131072
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=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 07532dd28c9f528a39c397b207537ed2
main.cpp: In function ‘int main()’:
main.cpp:11:18: error: ‘begin’ was not declared in this scope
main.cpp:11:18: error: ‘end’ was not declared in this scope
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/48578] Range-based for-loops do not compile when -nostdinc is given
2011-04-12 17:14 [Bug c++/48578] New: Range-based for-loops do not compile when -nostdinc is given jobnoorman at gmail dot com
@ 2011-04-12 17:39 ` redi at gcc dot gnu.org
2011-04-12 18:29 ` jobnoorman at gmail dot com
1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-12 17:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48578
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-12 17:39:15 UTC ---
According to the current C++0x draft that loop should call begin(l) and end(l)
but there are no declarations of those functions in your testcase, with or
without -nostdinc
According to the C++0x FDIS your example would work, but that's not implemented
in G++ 4.6.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/48578] Range-based for-loops do not compile when -nostdinc is given
2011-04-12 17:14 [Bug c++/48578] New: Range-based for-loops do not compile when -nostdinc is given jobnoorman at gmail dot com
2011-04-12 17:39 ` [Bug c++/48578] " redi at gcc dot gnu.org
@ 2011-04-12 18:29 ` jobnoorman at gmail dot com
1 sibling, 0 replies; 3+ messages in thread
From: jobnoorman at gmail dot com @ 2011-04-12 18:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48578
--- Comment #2 from Job Noorman <jobnoorman at gmail dot com> 2011-04-12 18:29:41 UTC ---
Ok I see. Thanks for the clarification!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-12 18:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-12 17:14 [Bug c++/48578] New: Range-based for-loops do not compile when -nostdinc is given jobnoorman at gmail dot com
2011-04-12 17:39 ` [Bug c++/48578] " redi at gcc dot gnu.org
2011-04-12 18:29 ` jobnoorman at gmail dot com
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).