Comments
Patch
commit db160eb9b07b62f3696e7358c74e6d59c68385d8
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jan 3 14:43:05 2013 -0500
PR c++/55419
PR c++/55753
* pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
TREE_CONSTANT.
@@ -14333,11 +14333,9 @@ tsubst_copy_and_build (tree t,
case TARGET_EXPR:
/* We can get here for a constant initializer of non-dependent type.
FIXME stop folding in cp_parser_initializer_clause. */
- gcc_assert (TREE_CONSTANT (t));
{
tree r = get_target_expr_sfinae (RECUR (TARGET_EXPR_INITIAL (t)),
complain);
- TREE_CONSTANT (r) = true;
RETURN (r);
}
new file mode 100644
@@ -0,0 +1,14 @@
+// PR c++/55753
+// { dg-options -std=c++11 }
+
+template <typename Tp>
+struct C {
+ constexpr C(const Tp& r) { }
+};
+
+template <typename Tp>
+struct B {
+ B() {
+ C<double> cpl = C<double>((true ? 1.0 : C<double>()));
+ }
+};