view gcc/testsuite/g++.old-deja/g++.law/operators18.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do assemble  }
// GROUPS passed operators
// opr-ampr file
// From: mecklen@oops.cs.utah.edu (Robert Mecklenburg)
// Date:     Thu, 8 Oct 92 16:33:08 -0600
// Subject:  Type conversion and overloading bugs in 2.2.2
// Message-ID: <9210082233.AA28203@hellgate.utah.edu>

        enum E { a, b, c };
        struct Estr {
            E value;
            Estr()                              {}
            Estr( int i ) : value( (E)i )       {}
            operator E()                        { return value; }
        };
        extern Estr baz();
        int bazz() { return baz() & 2; }