public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56904] New: rejection of legal code in c++11 mode. (maybe namespace lookup problem)
@ 2013-04-10 11:46 dirk.bonekaemper at dfs dot de
2013-04-10 12:10 ` [Bug c++/56904] " jakub at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: dirk.bonekaemper at dfs dot de @ 2013-04-10 11:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56904
Bug #: 56904
Summary: rejection of legal code in c++11 mode. (maybe
namespace lookup problem)
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: dirk.bonekaemper@dfs.de
Created attachment 29849
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29849
preprocessed c++ souce for bug report
Problem appears only with -std=c++11.
If I remove the global scope operator from the ::n::S::foo definition, it
compiles.
c++ -v -save-temps -std=c++11 -c gcc-4-8-0-namespace-problem.cc
Using built-in specs.
COLLECT_GCC=c++
Target: i686-pc-linux-gnu
Configured with: ../../packages/gcc-4.8.0/configure
--prefix=/usr/localdisk/bondi011/gcc-4.8.0 --enable-languages=c,c++
Thread model: posix
gcc version 4.8.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-c' '-shared-libgcc'
'-mtune=generic' '-march=pentiumpro'
/usr/localdisk/bondi011/gcc-4.8.0/libexec/gcc/i686-pc-linux-gnu/4.8.0/cc1plus
-E -quiet -v -D_GNU_SOURCE gcc-4-8-0-namespace-problem.cc -mtune=generic
-march=pentiumpro -std=c++11 -fpch-preprocess -o gcc-4-8-0-namespace-problem.ii
ignoring nonexistent directory
"/usr/localdisk/bondi011/gcc-4.8.0/lib/gcc/i686-pc-linux-gnu/4.8.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/localdisk/bondi011/gcc-4.8.0/lib/gcc/i686-pc-linux-gnu/4.8.0/../../../../include/c++/4.8.0
/usr/localdisk/bondi011/gcc-4.8.0/lib/gcc/i686-pc-linux-gnu/4.8.0/../../../../include/c++/4.8.0/i686-pc-linux-gnu
/usr/localdisk/bondi011/gcc-4.8.0/lib/gcc/i686-pc-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward
/usr/localdisk/bondi011/gcc-4.8.0/lib/gcc/i686-pc-linux-gnu/4.8.0/include
/usr/local/include
/usr/localdisk/bondi011/gcc-4.8.0/include
/usr/localdisk/bondi011/gcc-4.8.0/lib/gcc/i686-pc-linux-gnu/4.8.0/include-fixed
/usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-c' '-shared-libgcc'
'-mtune=generic' '-march=pentiumpro'
/usr/localdisk/bondi011/gcc-4.8.0/libexec/gcc/i686-pc-linux-gnu/4.8.0/cc1plus
-fpreprocessed gcc-4-8-0-namespace-problem.ii -quiet -dumpbase
gcc-4-8-0-namespace-problem.cc -mtune=generic -march=pentiumpro -auxbase
gcc-4-8-0-namespace-problem -std=c++11 -version -o
gcc-4-8-0-namespace-problem.s
GNU C++ (GCC) version 4.8.0 (i686-pc-linux-gnu)
compiled by GNU C version 4.8.0, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.8.0 (i686-pc-linux-gnu)
compiled by GNU C version 4.8.0, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 078491655d66ce4db43e7026e58f8fec
gcc-4-8-0-namespace-problem.cc:11:1: error: 'n' in 'enum n::E' does not name a
type
::n::E ::n::S::foo() { return e; }
^
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/56904] rejection of legal code in c++11 mode. (maybe namespace lookup problem)
2013-04-10 11:46 [Bug c++/56904] New: rejection of legal code in c++11 mode. (maybe namespace lookup problem) dirk.bonekaemper at dfs dot de
@ 2013-04-10 12:10 ` jakub at gcc dot gnu.org
2013-04-11 2:53 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-10 12:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56904
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-10 12:10:31 UTC ---
This stopped being accepted I think with http://gcc.gnu.org/r139611 , so if
this is indeed valid C++11, then it would be a regression. But whether it is
valid or not I'll leave to C++ maintainers.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/56904] rejection of legal code in c++11 mode. (maybe namespace lookup problem)
2013-04-10 11:46 [Bug c++/56904] New: rejection of legal code in c++11 mode. (maybe namespace lookup problem) dirk.bonekaemper at dfs dot de
2013-04-10 12:10 ` [Bug c++/56904] " jakub at gcc dot gnu.org
@ 2013-04-11 2:53 ` jason at gcc dot gnu.org
2013-04-11 2:54 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2013-04-11 2:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56904
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2013-04-11 02:53:29 UTC ---
In C++11, enums have scopes, so the :: after the E is interpreted as looking
for a member of E.
icc and clang reject the testcase for the same reason.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/56904] rejection of legal code in c++11 mode. (maybe namespace lookup problem)
2013-04-10 11:46 [Bug c++/56904] New: rejection of legal code in c++11 mode. (maybe namespace lookup problem) dirk.bonekaemper at dfs dot de
2013-04-10 12:10 ` [Bug c++/56904] " jakub at gcc dot gnu.org
2013-04-11 2:53 ` jason at gcc dot gnu.org
@ 2013-04-11 2:54 ` jason at gcc dot gnu.org
2013-04-11 9:16 ` jakub at gcc dot gnu.org
2013-04-12 7:23 ` dirk.bonekaemper at dfs dot de
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2013-04-11 2:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56904
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2013-04-11 02:54:34 UTC ---
See also DR 125:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#125
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/56904] rejection of legal code in c++11 mode. (maybe namespace lookup problem)
2013-04-10 11:46 [Bug c++/56904] New: rejection of legal code in c++11 mode. (maybe namespace lookup problem) dirk.bonekaemper at dfs dot de
` (2 preceding siblings ...)
2013-04-11 2:54 ` jason at gcc dot gnu.org
@ 2013-04-11 9:16 ` jakub at gcc dot gnu.org
2013-04-12 7:23 ` dirk.bonekaemper at dfs dot de
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-11 9:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56904
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-11 09:16:08 UTC ---
I guess you can either use
::n::E n::S::foo() { return e; }
or
::n::E (::n::S::foo)() { return e; }
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/56904] rejection of legal code in c++11 mode. (maybe namespace lookup problem)
2013-04-10 11:46 [Bug c++/56904] New: rejection of legal code in c++11 mode. (maybe namespace lookup problem) dirk.bonekaemper at dfs dot de
` (3 preceding siblings ...)
2013-04-11 9:16 ` jakub at gcc dot gnu.org
@ 2013-04-12 7:23 ` dirk.bonekaemper at dfs dot de
4 siblings, 0 replies; 6+ messages in thread
From: dirk.bonekaemper at dfs dot de @ 2013-04-12 7:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56904
--- Comment #5 from dirk.bonekaemper at dfs dot de 2013-04-12 07:23:34 UTC ---
First of all thanks for the fast reaction.
Knowing the problem (obvious in hindsight :-) I already found another
workaround: reopen the namespace.
Thanks again.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-04-12 7:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-10 11:46 [Bug c++/56904] New: rejection of legal code in c++11 mode. (maybe namespace lookup problem) dirk.bonekaemper at dfs dot de
2013-04-10 12:10 ` [Bug c++/56904] " jakub at gcc dot gnu.org
2013-04-11 2:53 ` jason at gcc dot gnu.org
2013-04-11 2:54 ` jason at gcc dot gnu.org
2013-04-11 9:16 ` jakub at gcc dot gnu.org
2013-04-12 7:23 ` dirk.bonekaemper at dfs dot de
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).