Message ID | 20200709175520.2390282-1-ppalka@redhat.com |
---|---|
State | New |
Headers | show |
Series | [committed] c++: Partially revert fix for PR c++/95497 [PR96132] | expand |
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index ff78ebda2dc..97dcc1b1d10 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -7444,6 +7444,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, { tree type = TREE_TYPE (t); if ((processing_template_decl && !COMPLETE_TYPE_P (type)) + || dependent_type_p (type) || is_really_empty_class (type, /*ignore_vptr*/false)) /* An empty class has no data to read. */ return true; diff --git a/gcc/testsuite/g++.dg/template/incomplete12.C b/gcc/testsuite/g++.dg/template/incomplete12.C new file mode 100644 index 00000000000..335e5356874 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/incomplete12.C @@ -0,0 +1,9 @@ +// PR c++/96132 +// { dg-do compile } + +template <int> class a; + +template <int b> class c { + a<b> e; + void operator=(c d) { e = d; } +};