This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/1639: template operator != interferes with const expressions
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1639: template operator != interferes with const expressions
- From: kaa at comail dot ru
- Date: 12 Jan 2001 23:02:18 -0000
- Reply-To: kaa at comail dot ru
>Number: 1639
>Category: c++
>Synopsis: template operator != interferes with const expressions
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Jan 12 15:06:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Artem Khodush
>Release: 20010108 snapshot
>Organization:
>Environment:
RedHat Linux 6.2 i386
>Description:
The testcase
template< class T > bool operator!=( T t1, T t2 ) { return !t1==t2; }
enum { e1, e2 };
struct S {
static const bool b= e1 != e2;
};
gives an error:
bug2.cxx:7: field initializer is not constant
This happens only when != arguments are enums, and
only when initializer is inside class declaration.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: