2016-09-16 Jakub Jelinek <jakub@redhat.com>
+ PR c++/77482
+ * error.c (dump_simple_decl): Only check DECL_DECLARED_CONCEPT_P
+ if DECL_LANG_SPECIFIC is non-NULL. Fix up formatting.
+
PR c++/77338
* constexpr.c (cxx_eval_constant_expression) <case PARM_DECL>: Only
call is_really_empty_class on complete types.
{
if (flags & TFF_DECL_SPECIFIERS)
{
- if (VAR_P (t)
- && DECL_DECLARED_CONSTEXPR_P (t))
- {
- if (DECL_DECLARED_CONCEPT_P (t))
- pp_cxx_ws_string (pp, "concept");
- else
- pp_cxx_ws_string (pp, "constexpr");
- }
+ if (VAR_P (t) && DECL_DECLARED_CONSTEXPR_P (t))
+ {
+ if (DECL_LANG_SPECIFIC (t) && DECL_DECLARED_CONCEPT_P (t))
+ pp_cxx_ws_string (pp, "concept");
+ else
+ pp_cxx_ws_string (pp, "constexpr");
+ }
dump_type_prefix (pp, type, flags & ~TFF_UNQUALIFIED_NAME);
pp_maybe_space (pp);
}
2016-09-16 Jakub Jelinek <jakub@redhat.com>
+ PR c++/77482
+ * g++.dg/cpp0x/constexpr-77482.C: New test.
+
PR c++/77379
* g++.dg/abi/abi-tag23.C: Adjust scan-assembler regex for differing
thunk offsets.
--- /dev/null
+// PR c++/77482
+// { dg-do compile { target c++11 } }
+
+constexpr auto x; // { dg-error "declaration\[^\n\r]*has no initializer" }
+extern struct S s;
+constexpr auto y = s; // { dg-error "has incomplete type" }