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]

[Bug c++/16696] Strange message when operator++ not found


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-23 21:08 -------
It is special cased:
        case POSTINCREMENT_EXPR:
        case POSTDECREMENT_EXPR:
          /* Look for an `operator++ (int)'.  If they didn't have
             one, then we fall back to the old way of doing things.  */
          if (flags & LOOKUP_COMPLAIN)
            pedwarn ("no `%D(int)' declared for postfix `%s', trying prefix operator instead",
                        fnname, 
                        operator_name_info[code].name);
          if (code == POSTINCREMENT_EXPR)
            code = PREINCREMENT_EXPR;
          else
            code = PREDECREMENT_EXPR;
          result = build_new_op (code, flags, arg1, NULL_TREE, NULL_TREE,
                                 overloaded_p);

which means -fpermissive does look do the transformation. :(
Why we do this is unknown as it comes from PRE EGCSE (aka CVS days).

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16696


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