* tree.c (strip_typedefs_expr) [TREE_LIST]: Fix iteration.
From-SVN: r262343
+2018-07-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/86378 - functional cast in noexcept-specifier.
+ * tree.c (strip_typedefs_expr) [TREE_LIST]: Fix iteration.
+
2018-07-02 Paolo Carlini <paolo.carlini@oracle.com>
* parser.c (set_and_check_decl_spec_loc): Use rich_location::add_range
tree it;
for (it = t; it; it = TREE_CHAIN (it))
{
- tree val = strip_typedefs_expr (TREE_VALUE (t), remove_attributes);
+ tree val = strip_typedefs_expr (TREE_VALUE (it), remove_attributes);
vec_safe_push (vec, val);
- if (val != TREE_VALUE (t))
+ if (val != TREE_VALUE (it))
changed = true;
gcc_assert (TREE_PURPOSE (it) == NULL_TREE);
}
--- /dev/null
+// PR c++/86378
+// { dg-do compile { target c++11 } }
+
+struct Pepper {};
+struct Apple { Apple(int) {} };
+
+struct Combination : Apple, Pepper
+{
+ Combination(Pepper p, Apple a)
+ : Apple(a), Pepper(p)
+ {}
+};
+
+struct MyCombination
+{
+ using Spice = Pepper;
+ using Fruit = Apple;
+
+ Combination combination;
+
+ template<typename T>
+ constexpr MyCombination(T&& t)
+ noexcept(noexcept(Combination(Spice(), Fruit(t))))
+ : combination(Spice(), Fruit(t))
+ {}
+};
+
+MyCombination obj(Apple(4));