Avoid crashing on erroneous static_assert usage
authorDodji Seketeli <dodji@redhat.com>
Mon, 6 Aug 2012 16:19:09 +0000 (16:19 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Mon, 6 Aug 2012 16:19:09 +0000 (18:19 +0200)
commit61b6d4cdee65148788a7638495ae61f8f2c93272
tree7715884997385ba1fb75caae6a47b4cf5b6ec6ad
parenta4a837968d01562e9caf7930670e236ae0fbf6a9
Avoid crashing on erroneous static_assert usage

When working on something else, I noticed that failing to provide the
second argument to the static_assert operator would lead to an ICE.

Fixed thus, and tested against trunk on x86_64-unknown-linux-gnu.

gcc/cp/

* semantics.c (finish_static_assert): Don't crash on erroneous
message or condition.

gcc/testsuite/

* g++.dg/cpp0x/static_assert8.C: New test.

From-SVN: r190182
gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/static_assert8.C [new file with mode: 0644]