On 11/01/2008, Mark Mitchell wrote:
>
> Exactly so.  I think that we have two kinds of pedwarns: those that are
> pedantic in the sense we use for C (like, that there cannot be a naked
> semicolon at the top-level of a file, or that "long long" is not in
> C++98) and those that refer to semantically reasonable constructs that
> we previously accepted, often because they were allowed by cfront or the
> ARM.  With flag_permissive, we probably want the latter category to be
> warnings at most; without flag_permissive, we want them to be errors.

I'll start the ball rolling with cp/call.c, cp/class.c and cp/cvt.c
I'll call the latter category isowarns for the purpose of this mail,
they are technically illegal constructs that are errors without
-fpermissive.  My suggestion of pedwarn/isowarn given in capitals on
each entry.

call.c:3258 build_conditional_expr  PEDWARN
"ISO C++ forbids omitting the middle term of a ?: expression."
GNU extension, currently allowed unless -pedantic.

call.c:3867 build_new_op ISOWARN
"no 'operator++(int)' declared for postfix '++', trying prefix operator instead"
This should not be accepted without -fpermissive

call.c:4352 convert_like_real ISOWARN
  pedwarn ("invalid conversion from %qT to %qT", TREE_TYPE (expr), totype);
  if (fn)
    pedwarn ("  initializing argument %P of %qD", argnum, fn);
Not sure about this one ... isowarn I think.

call.c:4953 build_over_call ISOWARN
"passing 'const X' as 'this' argument of 'void X::f()' discards qualifiers"

call.c:6463 joust PEDWARN
"ISO C++ says that these are ambiguous, even though the worst
conversion for the first is better than the worst conversion for the
second:"
GNU extension, currently entirely disallowed by -pedantic, otherwise pedwarn.
I think that's OK.

class.c:2483 finish_struct_anon ISOWARN
""%q+#D invalid; an anonymous struct can only have non-static data members"
"private member %q+#D in anonymous struct"
(and similarly for anonymous unions adn protected members)
Not sure how to trigger this, but I don't think is is intended as a
GNU extension so should require -fpermissive

class.c:3037 check_field_decls ISOWARN
"field 'int S::S' with same name as class"

class.c:5995 resolve_address_of_overloaded_function ISOWARN
"assuming pointer to member %qD (a pointer to member can only be
formed with %<&%E%>)"

class.c:6358 note_name_declared_in_class ISOWARN
"declaration of 'i'
changes meaning of 'i' from '<anonymous enum> i'"

cvt.c:382 warn_ref_binding ISOWARN
"initialization of non-const reference type %q#T from rvalue of type %qT"

cvt.c:452 convert_to_reference ISOWARN
"conversion from %qT to %qT discards qualifiers"

cvt.c:656  ocp_convert ISOWARN
"conversion from %q#T to %q#T"

cvt.c:902 convert_to_void ???
"statement cannot resolve address of overloaded function"
Shouldn't this be a hard error?  What benefit is there to allowing
this with -fpermissive?


Jon

Reply via email to