diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-03 20:37:10 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-03 20:37:10 +0000 |
commit | 76d97e46544bfa3f9167c1876a1e1924700f31c2 (patch) | |
tree | 6fdc88e7637eda896e7155d38c27735f45192cb5 | |
parent | aa952e89029f62e1004bc618fcff564074dc5a91 (diff) |
PR c++/55842
* semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@194871 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/has_nothrow_constructor-2.C | 7 |
3 files changed, 12 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f1c9dedc22a..4e7b93395cf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2013-01-03 Jason Merrill <jason@redhat.com> + PR c++/55842 + * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept. + PR c++/55856 * semantics.c (build_data_member_initialization): Handle DECL_EXPR. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index dcf119d2b00..d39d50a5f44 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5392,7 +5392,8 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2) return (trait_expr_value (CPTK_HAS_TRIVIAL_CONSTRUCTOR, type1, type2) || (CLASS_TYPE_P (type1) && (t = locate_ctor (type1)) - && TYPE_NOTHROW_P (TREE_TYPE (t)))); + && (maybe_instantiate_noexcept (t), + TYPE_NOTHROW_P (TREE_TYPE (t))))); case CPTK_HAS_TRIVIAL_CONSTRUCTOR: type1 = strip_array_types (type1); diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_constructor-2.C b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor-2.C new file mode 100644 index 00000000000..9191c3e97f8 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor-2.C @@ -0,0 +1,7 @@ +// PR c++/55842 +// { dg-options -std=c++11 } + +template <class=void> struct number { + number() noexcept(noexcept(0)) { } +}; +const int z=__has_nothrow_constructor(number<>); |