[Bug c++/60760] New: arithmetic on null pointers should not be allowed in constant expressions

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Apr 4 14:53:00 GMT 2014


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

            Bug ID: 60760
           Summary: arithmetic on null pointers should not be allowed in
                    constant expressions
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

G++ should not compile this:

constexpr int* ptr = nullptr;
constexpr int* ptr2 = ptr + 1;



More information about the Gcc-bugs mailing list