PR c++/77338
* constexpr.c (cxx_eval_constant_expression) <case PARM_DECL>: Only
call is_really_empty_class on complete types.
* g++.dg/cpp0x/decltype-77338.C: New test.
From-SVN: r240196
2016-09-16 Jakub Jelinek <jakub@redhat.com>
+ PR c++/77338
+ * constexpr.c (cxx_eval_constant_expression) <case PARM_DECL>: Only
+ call is_really_empty_class on complete types.
+
PR c++/77375
* class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any
TYPE_HAS_MUTABLE_P for any bases.
/* Defer in case this is only used for its type. */;
else if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE)
/* Defer, there's no lvalue->rvalue conversion. */;
- else if (is_really_empty_class (TREE_TYPE (t)))
+ else if (COMPLETE_TYPE_P (TREE_TYPE (t))
+ && is_really_empty_class (TREE_TYPE (t)))
{
/* If the class is empty, we aren't actually loading anything. */
r = build_constructor (TREE_TYPE (t), NULL);
2016-09-16 Jakub Jelinek <jakub@redhat.com>
+ PR c++/77338
+ * g++.dg/cpp0x/decltype-77338.C: New test.
+
PR c++/77375
* g++.dg/cpp0x/mutable1.C: New test.
--- /dev/null
+// PR c++/77338
+// { dg-do compile { target c++11 } }
+
+struct S;
+
+template <typename>
+auto f (S s) -> decltype (s (s)); // { dg-error "no match for call to" }