diff options
author | Jason Merrill <jason@redhat.com> | 2011-03-28 11:49:45 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-03-28 11:49:45 -0400 |
commit | 0309d28824f040972a212183b34c45d59449b529 (patch) | |
tree | b18476f78bf9581d99d71e5b9559262a3071a804 | |
parent | 7450b54f8413bd7be5d0a822f42ad1a24b84582c (diff) | |
download | gcc-0309d28824f040972a212183b34c45d59449b529.zip gcc-0309d28824f040972a212183b34c45d59449b529.tar.gz gcc-0309d28824f040972a212183b34c45d59449b529.tar.bz2 |
except.c (build_noexcept_spec): Call cxx_constant_value after converting to bool.
* except.c (build_noexcept_spec): Call cxx_constant_value after
converting to bool.
From-SVN: r171609
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/except.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept5.C | 15 |
4 files changed, 25 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 597093e..3bbeddf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-03-28 Jason Merrill <jason@redhat.com> + + * except.c (build_noexcept_spec): Call cxx_constant_value after + converting to bool. + 2011-03-25 Kai Tietz <ktietz@redhat.com> * lex.c (interface_strcmp): Handle dos-paths. diff --git a/gcc/cp/except.c b/gcc/cp/except.c index c05e507..a814d67 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -1203,10 +1203,10 @@ build_noexcept_spec (tree expr, int complain) it until instantiation. */ if (!processing_template_decl) { - expr = cxx_constant_value (expr); expr = perform_implicit_conversion_flags (boolean_type_node, expr, complain, LOOKUP_NORMAL); + expr = cxx_constant_value (expr); } if (expr == boolean_true_node) return noexcept_true_spec; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 53424d2..863f599 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-03-28 Jason Merrill <jason@redhat.com> + + * g++.dg/cpp0x/constexpr-noexcept.C: New. + 2011-03-28 H.J. Lu <hongjiu.lu@intel.com> PR testsuite/48276 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept5.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept5.C new file mode 100644 index 0000000..7bf961b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept5.C @@ -0,0 +1,15 @@ +// { dg-options -std=c++0x } + +struct booleable { + bool data; + constexpr explicit operator bool() { return data; } +}; + +constexpr booleable truthy_func() { return {true}; } + +void funky() noexcept(truthy_func()) {} + +int main() { + funky(); + return 0; +} |