re PR c++/55842 (C++11 ICE with boost multi-precision and boost variant)
authorJason Merrill <jason@redhat.com>
Thu, 3 Jan 2013 20:36:14 +0000 (15:36 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 3 Jan 2013 20:36:14 +0000 (15:36 -0500)
PR c++/55842
* semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.

From-SVN: r194869

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/g++.dg/ext/has_nothrow_constructor-2.C [new file with mode: 0644]

index dda06fdb3d208af27ae9d3d5aeee39556fc7e45f..56fcfa669adcadec4e77eab63d68e938655ed412 100644 (file)
@@ -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.
 
index 9f8119f50698b3723451a3204d16a84b5a9bbcf7..2e022958211d3de35d37367a792b5b53dfd6fc13 100644 (file)
@@ -5454,7 +5454,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 (file)
index 0000000..9191c3e
--- /dev/null
@@ -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<>);