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
This commit is contained in:
parent
40b864f141
commit
b671df813a
@ -1,3 +1,9 @@
|
||||
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;
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
17
gcc/testsuite/g++.dg/cpp1z/pr84325.C
Normal file
17
gcc/testsuite/g++.dg/cpp1z/pr84325.C
Normal file
@ -0,0 +1,17 @@
|
||||
// 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;
|
Loading…
Reference in New Issue
Block a user