This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/9256: C++ compiler conformance to Standard proposal 337


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]