public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18020] New: issue with enum in a template
@ 2004-10-15 18:05 gmorin1 at bloomberg dot net
  2004-10-15 18:21 ` [Bug c++/18020] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gmorin1 at bloomberg dot net @ 2004-10-15 18:05 UTC (permalink / raw)
  To: gcc-bugs

Here we go:

gmorin@linux:~> cat foo.cpp
template <typename FOO>
struct bar {
    enum {
        MASK = ((1 << 17)-1)
        , IT_MASK = (~MASK)
        , ITERATION_INC = (MASK+1)
    };
};

int baz = bar<int>::IT_MASK;
gmorin@linux:~> g++ -o /dev/null -c foo.cpp
foo.cpp: In instantiation of `bar<int>':
foo.cpp:10:   instantiated from here
foo.cpp:3: error: enumerator value for `IT_MASK' not integer constant
gmorin@linux:~> gcc -v
Reading specs from /openpkg/lib/gcc/i686-pc-linux-gnu/3.4.2/specs
Configured with: ../configure --cache-file=./config.cache
--srcdir=/openpkg/RPM/TMP/gcc-3.4.2/obj/.. --prefix=/openpkg
--exec-prefix=/openpkg --includedir=/openpkg/include/gcc
--libexecdir=/openpkg/libexec/gcc --with-gxx-include-dir=/openpkg/include/g++
--with-local-prefix=/openpkg/lib/gcc --enable-languages=c,c++
--enable-threads=posix --disable-maintainer-mode --disable-shared --disable-nls
--with-gnu-ld --with-ld=/openpkg/bin/ld --with-gnu-as --with-as=/openpkg/bin/as
Thread model: posix
gcc version 3.4.2 (OpenPKG-CURRENT)
gmorin@linux:~> uname -a
Linux linux 2.4.21-99-smp4G #1 SMP Wed Sep 24 14:13:20 UTC 2003 i686 athlon i386
GNU/Linux

This is a Suse 9.0 with gcc from CURRENT OpenPKG. It works if you remove the
template declaration.

-- 
           Summary: issue with enum in a template
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gmorin1 at bloomberg dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18020


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-10-27  4:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-15 18:05 [Bug c++/18020] New: issue with enum in a template gmorin1 at bloomberg dot net
2004-10-15 18:21 ` [Bug c++/18020] " pinskia at gcc dot gnu dot org
2004-10-15 18:57 ` bangerth at dealii dot org
2004-10-15 19:07 ` gmorin1 at bloomberg dot net
2004-10-15 19:17 ` [Bug c++/18020] [3.4/4.0 regression] rejects valid definition of enum value in template bangerth at dealii dot org
2004-10-15 19:17 ` bangerth at dealii dot org
2004-10-15 19:43 ` pinskia at gcc dot gnu dot org
2004-10-26 22:15 ` mmitchel at gcc dot gnu dot org
2004-10-27  2:23 ` cvs-commit at gcc dot gnu dot org
2004-10-27  4:33 ` mmitchel at gcc dot gnu dot org
2004-10-27  4:33 ` cvs-commit at gcc dot gnu dot org

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).