This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9256: C++ compiler conformance to Standard proposal 337
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, pavel_vozenilek at hotmail dot com
- Date: 10 Jan 2003 01:02:30 -0000
- Subject: Re: c++/9256: C++ compiler conformance to Standard proposal 337
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, pavel_vozenilek at hotmail dot com, gcc-gnats at gcc dot gnu dot org
Synopsis: C++ compiler conformance to Standard proposal 337
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Jan 9 17:02:29 2003
State-Changed-Why:
Confirmed. A simple testcase is that this must not compile:
------------------------
struct Abstract {
virtual void f() = 0;
};
Abstract (*a)[2];
--------------------------
A more complicated that this should succeed at run-time:
--------------------------
#include <cassert>
// must match all non-abstract types (except U=void, U a reference, etc)
template<typename U>
int check(U (*)[1]) { return 1;};
// worst case match for everything else
template<typename U>
int check(...) { return 2;};
struct Abstract {
virtual void f() = 0;
};
int main ()
{
assert (check<int> (0) == 1);
assert (check<Abstract> (0) == 2);
};
--------------------------
gcc3.4 is wrong on both testcases.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9256