public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67981] New: new expression with zero size not diagnosed
@ 2015-10-16  2:33 msebor at gcc dot gnu.org
  2015-10-16  2:34 ` [Bug c++/67981] " msebor at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: msebor at gcc dot gnu.org @ 2015-10-16  2:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67981

            Bug ID: 67981
           Summary: new expression with zero size not diagnosed
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Continuing with new expression conformance issues (bug 67913 and bug 67917):

In 5.3.4, p6, C++ 11 says that "Every constant-expression in a
noptr-new-declarator shall be an integral constant expression (5.19) and
evaluate to a strictly positive value."  C++ 14 has an equivalent requirement.

The following test case shows that gcc doesn't implement this constraint and
accepts a constant expression with a zero value:

$ echo "void* f () { return new char [0]; }" | g++ -Wall -Werror -Wextra
-Wpedantic -c -std=c++11 -xc++ -


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-16 23:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-16  2:33 [Bug c++/67981] New: new expression with zero size not diagnosed msebor at gcc dot gnu.org
2015-10-16  2:34 ` [Bug c++/67981] " msebor at gcc dot gnu.org
2015-10-16 21:54 ` Casey at Carter dot net
2015-10-16 23:46 ` msebor at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).