diff options
author | Jason Merrill <jason@redhat.com> | 2015-01-12 09:15:07 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2015-01-12 09:15:07 -0500 |
commit | 49c8bc0c77ee47f604c1e1ebe41cd9170fd33f48 (patch) | |
tree | 3e6c9170b9c3b584b53f03d838e4ff08e2a0253e /gcc/cp/constexpr.c | |
parent | 9a4fbc59086660c0348e7f233fed2a4ce7694235 (diff) | |
download | gcc-49c8bc0c77ee47f604c1e1ebe41cd9170fd33f48.zip gcc-49c8bc0c77ee47f604c1e1ebe41cd9170fd33f48.tar.gz gcc-49c8bc0c77ee47f604c1e1ebe41cd9170fd33f48.tar.bz2 |
re PR c++/64547 (A non-const constexpr function is rejected incorrectly)
PR c++/64547
* constexpr.c (cxx_eval_call_expression): A call to a void
function doesn't need to return a value.
From-SVN: r219466
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r-- | gcc/cp/constexpr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 9a0d518..650250b 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -1386,6 +1386,8 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t, value by evaluating *this, but we don't bother; there's no need to put such a call in the hash table. */ result = lval ? ctx->object : ctx->ctor; + else if (VOID_TYPE_P (TREE_TYPE (res))) + result = void_node; else { result = *ctx->values->get (slot ? slot : res); |