constexpr.c (cxx_eval_check_shift_p): New function.
authorMarek Polacek <polacek@redhat.com>
Tue, 2 Dec 2014 17:23:34 +0000 (17:23 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 2 Dec 2014 17:23:34 +0000 (17:23 +0000)
commit253a921b41ddb028244531c5b7f4039caf9fcbda
tree03e39b9b966b035070baec1018ed17c536b705a9
parent73bd83290ace3d8e3256103a59d79e6ec3946964
constexpr.c (cxx_eval_check_shift_p): New function.

* constexpr.c (cxx_eval_check_shift_p): New function.
(cxx_eval_binary_expression): Call it.  Set NON_CONSTANT_P if it
returns true.

* g++.dg/cpp0x/constexpr-shift1.C: New test.
* g++.dg/cpp1y/constexpr-shift1.C: New test.
* g++.dg/ubsan/pr63956.C: Add dg-errors.

From-SVN: r218279
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-shift1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/constexpr-shift1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ubsan/pr63956.C