This is the mail archive of the gcc-patches@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: RFA: PATCH to initializer_constant_valid_p for c++/38880


Ian Lance Taylor wrote:
However, your patch does mean that
    char *p1;
    short a[] = { p1 + p1 };
may do something unexpected.

That's ill-formed; you can't add two pointers in C++.


And to then wonder why
POINTER_PLUS_EXPR wasn't used instead of PLUS_EXPR.

Because http://gcc.gnu.org/viewcvs?view=rev&revision=143442 made the compiler stop folding to POINTER_PLUS_EXPR.


Jason


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