Commit b671df81 by Marek Polacek Committed by Marek Polacek

re PR c++/84325 (internal compiler error, in cxx_eval_constant_expression gcc/cp/constexpr.c:4740)

	PR c++/84325
	* tree.c (replace_placeholders_r): Only check TREE_CONSTANT on
	non-types.

	* g++.dg/cpp1z/pr84325.C: New test.

From-SVN: r258008
parent 40b864f1
2018-02-26 Marek Polacek <polacek@redhat.com>
PR c++/84325
* tree.c (replace_placeholders_r): Only check TREE_CONSTANT on
non-types.
2018-02-26 Jason Merrill <jason@redhat.com>
PR c++/84447 - ICE with deleted inherited ctor with default arg.
......
......@@ -3091,7 +3091,7 @@ replace_placeholders_r (tree* t, int* walk_subtrees, void* data_)
replace_placeholders_t *d = static_cast<replace_placeholders_t*>(data_);
tree obj = d->obj;
if (TREE_CONSTANT (*t))
if (TYPE_P (*t) || TREE_CONSTANT (*t))
{
*walk_subtrees = false;
return NULL_TREE;
......
2018-02-26 Marek Polacek <polacek@redhat.com>
PR c++/84325
* g++.dg/cpp1z/pr84325.C: New test.
2018-02-26 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/builtins-3.c: Move vec_neg builtin tests to
......
// PR c++/84325
// { dg-do compile }
// { dg-options "-std=c++17" }
struct seconds { int i_{0}; constexpr seconds (int) {} };
template <char... _Digits> constexpr seconds operator""_s() {
return seconds(0);
}
constexpr seconds operator""_s(long double i) {
return seconds(0);
}
template<class TYPE>
struct Param {
constexpr static inline seconds time_to_wait{10_s};
};
struct Empty {};
Param<Empty> p;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment