rfg@MCC.COM (Ron Guilmette) (05/04/89)
In the following source file, errors are not properly flagged for attempts to give default arguments within (binary) operator declaration formal argument lists. b063 had missed error(s) as follows: 11: int operator + (st st1, st st2 = st_object); // ERROR 12: int operator - (st st1, st st2 = st_object); // ERROR 13: int operator & (st st1, st st2 = st_object); // ERROR 14: int operator * (st st1, st st2 = st_object); // ERROR 16: int operator / (st st1, st st2 = st_object); // ERROR 17: int operator % (st st1, st st2 = st_object); // ERROR 18: int operator ^ (st st1, st st2 = st_object); // ERROR 19: int operator | (st st1, st st2 = st_object); // ERROR 20: int operator >> (st st1, st st2 = st_object); // ERROR 21: int operator << (st st1, st st2 = st_object); // ERROR 22: int operator && (st st1, st st2 = st_object); // ERROR 23: int operator || (st st1, st st2 = st_object); // ERROR 26: int operator == (st st1, st st2 = st_object); // ERROR 27: int operator != (st st1, st st2 = st_object); // ERROR 28: int operator < (st st1, st st2 = st_object); // ERROR 29: int operator > (st st1, st st2 = st_object); // ERROR 30: int operator <= (st st1, st st2 = st_object); // ERROR 31: int operator >= (st st1, st st2 = st_object); // ERROR 33: int operator = (st st1, st st2 = st_object); // ERROR 34: int operator += (st st1, st st2 = st_object); // ERROR 35: int operator -= (st st1, st st2 = st_object); // ERROR 36: int operator *= (st st1, st st2 = st_object); // ERROR 37: int operator /= (st st1, st st2 = st_object); // ERROR 38: int operator %= (st st1, st st2 = st_object); // ERROR 39: int operator ^= (st st1, st st2 = st_object); // ERROR 40: int operator &= (st st1, st st2 = st_object); // ERROR 41: int operator |= (st st1, st st2 = st_object); // ERROR 42: int operator >>= (st st1, st st2 = st_object); // ERROR 43: int operator <<= (st st1, st st2 = st_object); // ERROR 45: int operator [] (st st1, st st2 = st_object); // ERROR 47: int operator + (st st1 = st_object, st st2 = st_object); // ERROR 48: int operator - (st st1 = st_object, st st2 = st_object); // ERROR 49: int operator & (st st1 = st_object, st st2 = st_object); // ERROR 50: int operator * (st st1 = st_object, st st2 = st_object); // ERROR 52: int operator / (st st1 = st_object, st st2 = st_object); // ERROR 53: int operator % (st st1 = st_object, st st2 = st_object); // ERROR 54: int operator ^ (st st1 = st_object, st st2 = st_object); // ERROR 55: int operator | (st st1 = st_object, st st2 = st_object); // ERROR 56: int operator >> (st st1 = st_object, st st2 = st_object); // ERROR 57: int operator << (st st1 = st_object, st st2 = st_object); // ERROR 58: int operator && (st st1 = st_object, st st2 = st_object); // ERROR 59: int operator || (st st1 = st_object, st st2 = st_object); // ERROR 62: int operator == (st st1 = st_object, st st2 = st_object); // ERROR 63: int operator != (st st1 = st_object, st st2 = st_object); // ERROR 64: int operator < (st st1 = st_object, st st2 = st_object); // ERROR 65: int operator > (st st1 = st_object, st st2 = st_object); // ERROR 66: int operator <= (st st1 = st_object, st st2 = st_object); // ERROR 67: int operator >= (st st1 = st_object, st st2 = st_object); // ERROR 69: int operator = (st st1 = st_object, st st2 = st_object); // ERROR 70: int operator += (st st1 = st_object, st st2 = st_object); // ERROR 71: int operator -= (st st1 = st_object, st st2 = st_object); // ERROR 72: int operator *= (st st1 = st_object, st st2 = st_object); // ERROR 73: int operator /= (st st1 = st_object, st st2 = st_object); // ERROR 74: int operator %= (st st1 = st_object, st st2 = st_object); // ERROR 75: int operator ^= (st st1 = st_object, st st2 = st_object); // ERROR 76: int operator &= (st st1 = st_object, st st2 = st_object); // ERROR 77: int operator |= (st st1 = st_object, st st2 = st_object); // ERROR 78: int operator >>= (st st1 = st_object, st st2 = st_object); // ERROR 79: int operator <<= (st st1 = st_object, st st2 = st_object); // ERROR 81: int operator [] (st st1 = st_object, st st2 = st_object); // ERROR 84: int operator + (st st2 = st_object); // ERROR 85: int operator - (st st2 = st_object); // ERROR 86: int operator & (st st2 = st_object); // ERROR 87: int operator * (st st2 = st_object); // ERROR 89: int operator / (st st2 = st_object); // ERROR 90: int operator % (st st2 = st_object); // ERROR 91: int operator ^ (st st2 = st_object); // ERROR 92: int operator | (st st2 = st_object); // ERROR 93: int operator >> (st st2 = st_object); // ERROR 94: int operator << (st st2 = st_object); // ERROR 95: int operator && (st st2 = st_object); // ERROR 96: int operator || (st st2 = st_object); // ERROR 99: int operator == (st st2 = st_object); // ERROR 100: int operator != (st st2 = st_object); // ERROR 101: int operator < (st st2 = st_object); // ERROR 102: int operator > (st st2 = st_object); // ERROR 103: int operator <= (st st2 = st_object); // ERROR 104: int operator >= (st st2 = st_object); // ERROR 106: int operator = (st st2 = st_object); // ERROR 107: int operator += (st st2 = st_object); // ERROR 108: int operator -= (st st2 = st_object); // ERROR 109: int operator *= (st st2 = st_object); // ERROR 110: int operator /= (st st2 = st_object); // ERROR 111: int operator %= (st st2 = st_object); // ERROR 112: int operator ^= (st st2 = st_object); // ERROR 113: int operator &= (st st2 = st_object); // ERROR 114: int operator |= (st st2 = st_object); // ERROR 115: int operator >>= (st st2 = st_object); // ERROR 116: int operator <<= (st st2 = st_object); // ERROR 118: int operator [] (st st2 = st_object); // ERROR b063: FAILED --------------------------------------------------------------------------- // Check that it is illegal to declare binary operators with // either one or two formal parameters which have default values. // In particular, check the subscripting operator []. struct st { int member; }; st st_object; int operator + (st st1, st st2 = st_object); // ERROR int operator - (st st1, st st2 = st_object); // ERROR int operator & (st st1, st st2 = st_object); // ERROR int operator * (st st1, st st2 = st_object); // ERROR int operator / (st st1, st st2 = st_object); // ERROR int operator % (st st1, st st2 = st_object); // ERROR int operator ^ (st st1, st st2 = st_object); // ERROR int operator | (st st1, st st2 = st_object); // ERROR int operator >> (st st1, st st2 = st_object); // ERROR int operator << (st st1, st st2 = st_object); // ERROR int operator && (st st1, st st2 = st_object); // ERROR int operator || (st st1, st st2 = st_object); // ERROR // comparison operators (all 6) int operator == (st st1, st st2 = st_object); // ERROR int operator != (st st1, st st2 = st_object); // ERROR int operator < (st st1, st st2 = st_object); // ERROR int operator > (st st1, st st2 = st_object); // ERROR int operator <= (st st1, st st2 = st_object); // ERROR int operator >= (st st1, st st2 = st_object); // ERROR int operator = (st st1, st st2 = st_object); // ERROR int operator += (st st1, st st2 = st_object); // ERROR int operator -= (st st1, st st2 = st_object); // ERROR int operator *= (st st1, st st2 = st_object); // ERROR int operator /= (st st1, st st2 = st_object); // ERROR int operator %= (st st1, st st2 = st_object); // ERROR int operator ^= (st st1, st st2 = st_object); // ERROR int operator &= (st st1, st st2 = st_object); // ERROR int operator |= (st st1, st st2 = st_object); // ERROR int operator >>= (st st1, st st2 = st_object); // ERROR int operator <<= (st st1, st st2 = st_object); // ERROR int operator [] (st st1, st st2 = st_object); // ERROR int operator + (st st1 = st_object, st st2 = st_object); // ERROR int operator - (st st1 = st_object, st st2 = st_object); // ERROR int operator & (st st1 = st_object, st st2 = st_object); // ERROR int operator * (st st1 = st_object, st st2 = st_object); // ERROR int operator / (st st1 = st_object, st st2 = st_object); // ERROR int operator % (st st1 = st_object, st st2 = st_object); // ERROR int operator ^ (st st1 = st_object, st st2 = st_object); // ERROR int operator | (st st1 = st_object, st st2 = st_object); // ERROR int operator >> (st st1 = st_object, st st2 = st_object); // ERROR int operator << (st st1 = st_object, st st2 = st_object); // ERROR int operator && (st st1 = st_object, st st2 = st_object); // ERROR int operator || (st st1 = st_object, st st2 = st_object); // ERROR // comparison operators (all 6) int operator == (st st1 = st_object, st st2 = st_object); // ERROR int operator != (st st1 = st_object, st st2 = st_object); // ERROR int operator < (st st1 = st_object, st st2 = st_object); // ERROR int operator > (st st1 = st_object, st st2 = st_object); // ERROR int operator <= (st st1 = st_object, st st2 = st_object); // ERROR int operator >= (st st1 = st_object, st st2 = st_object); // ERROR int operator = (st st1 = st_object, st st2 = st_object); // ERROR int operator += (st st1 = st_object, st st2 = st_object); // ERROR int operator -= (st st1 = st_object, st st2 = st_object); // ERROR int operator *= (st st1 = st_object, st st2 = st_object); // ERROR int operator /= (st st1 = st_object, st st2 = st_object); // ERROR int operator %= (st st1 = st_object, st st2 = st_object); // ERROR int operator ^= (st st1 = st_object, st st2 = st_object); // ERROR int operator &= (st st1 = st_object, st st2 = st_object); // ERROR int operator |= (st st1 = st_object, st st2 = st_object); // ERROR int operator >>= (st st1 = st_object, st st2 = st_object); // ERROR int operator <<= (st st1 = st_object, st st2 = st_object); // ERROR int operator [] (st st1 = st_object, st st2 = st_object); // ERROR struct base { int operator + (st st2 = st_object); // ERROR int operator - (st st2 = st_object); // ERROR int operator & (st st2 = st_object); // ERROR int operator * (st st2 = st_object); // ERROR int operator / (st st2 = st_object); // ERROR int operator % (st st2 = st_object); // ERROR int operator ^ (st st2 = st_object); // ERROR int operator | (st st2 = st_object); // ERROR int operator >> (st st2 = st_object); // ERROR int operator << (st st2 = st_object); // ERROR int operator && (st st2 = st_object); // ERROR int operator || (st st2 = st_object); // ERROR // comparison operators (all 6) int operator == (st st2 = st_object); // ERROR int operator != (st st2 = st_object); // ERROR int operator < (st st2 = st_object); // ERROR int operator > (st st2 = st_object); // ERROR int operator <= (st st2 = st_object); // ERROR int operator >= (st st2 = st_object); // ERROR int operator = (st st2 = st_object); // ERROR int operator += (st st2 = st_object); // ERROR int operator -= (st st2 = st_object); // ERROR int operator *= (st st2 = st_object); // ERROR int operator /= (st st2 = st_object); // ERROR int operator %= (st st2 = st_object); // ERROR int operator ^= (st st2 = st_object); // ERROR int operator &= (st st2 = st_object); // ERROR int operator |= (st st2 = st_object); // ERROR int operator >>= (st st2 = st_object); // ERROR int operator <<= (st st2 = st_object); // ERROR int operator [] (st st2 = st_object); // ERROR }; --------------------------------------------------------------------------- /usr/local/src/src/g++/build/sun3/1.35-.0-.0/g++ -B/usr/local/src/src/g++/build/sun3/1.35-.0-.0/ -Wall -Wwrite-strings -g -S -v b063.C g++ version 1.35.0-.0 /usr/local/src/src/g++/build/sun3/1.35-.0-.0/cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Wall -D__HAVE_68881__ -Dmc68020 b063.C /tmp/cca22995.cpp GNU CPP version 1.35.0-.0 /usr/local/src/src/g++/build/sun3/1.35-.0-.0/c++ /tmp/cca22995.cpp -quiet -dumpbase b063.C -Wall -Wwrite-strings -noreg -version -G -o b063.s GNU C++ version 1.35.0-.0 (68k, MIT syntax) compiled by GNU C version 1.34.1. b063.C:81: warning: `int operator [] (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:79: warning: `int operator <<= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:78: warning: `int operator >>= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:77: warning: `int operator |= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:76: warning: `int operator &= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:75: warning: `int operator ^= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:74: warning: `int operator %= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:73: warning: `int operator /= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:72: warning: `int operator *= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:71: warning: `int operator -= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:70: warning: `int operator += (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:69: warning: `int operator = (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:67: warning: `int operator >= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:66: warning: `int operator <= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:65: warning: `int operator > (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:64: warning: `int operator < (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:63: warning: `int operator != (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:62: warning: `int operator == (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:59: warning: `int operator || (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:58: warning: `int operator && (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:57: warning: `int operator << (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:56: warning: `int operator >> (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:55: warning: `int operator | (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:54: warning: `int operator ^ (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:53: warning: `int operator % (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:52: warning: `int operator / (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:50: warning: `int operator * (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:49: warning: `int operator & (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:48: warning: `int operator - (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:47: warning: `int operator + (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:81: warning: `int operator [] (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:79: warning: `int operator <<= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:78: warning: `int operator >>= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:77: warning: `int operator |= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:76: warning: `int operator &= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:75: warning: `int operator ^= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:74: warning: `int operator %= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:73: warning: `int operator /= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:72: warning: `int operator *= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:71: warning: `int operator -= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:70: warning: `int operator += (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:69: warning: `int operator = (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:67: warning: `int operator >= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:66: warning: `int operator <= (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:65: warning: `int operator > (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:64: warning: `int operator < (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:63: warning: `int operator != (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:62: warning: `int operator == (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:59: warning: `int operator || (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:58: warning: `int operator && (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:57: warning: `int operator << (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:56: warning: `int operator >> (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:55: warning: `int operator | (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:54: warning: `int operator ^ (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:53: warning: `int operator % (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:52: warning: `int operator / (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:50: warning: `int operator * (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:49: warning: `int operator & (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:48: warning: `int operator - (struct st (= st_object ), struct st (= st_object ))' defined but not used b063.C:47: warning: `int operator + (struct st (= st_object ), struct st (= st_object ))' defined but not used