Commit 8f03e02f by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/77482 (Segfault when compiling ill-formed constexpr code)

	PR c++/77482
	* error.c (dump_simple_decl): Only check DECL_DECLARED_CONCEPT_P
	if DECL_LANG_SPECIFIC is non-NULL.  Fix up formatting.

	* g++.dg/cpp0x/constexpr-77482.C: New test.

From-SVN: r240198
parent e80cb545
2016-09-16 Jakub Jelinek <jakub@redhat.com> 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 PR c++/77338
* constexpr.c (cxx_eval_constant_expression) <case PARM_DECL>: Only * constexpr.c (cxx_eval_constant_expression) <case PARM_DECL>: Only
call is_really_empty_class on complete types. call is_really_empty_class on complete types.
......
...@@ -959,14 +959,13 @@ dump_simple_decl (cxx_pretty_printer *pp, tree t, tree type, int flags) ...@@ -959,14 +959,13 @@ dump_simple_decl (cxx_pretty_printer *pp, tree t, tree type, int flags)
{ {
if (flags & TFF_DECL_SPECIFIERS) if (flags & TFF_DECL_SPECIFIERS)
{ {
if (VAR_P (t) if (VAR_P (t) && DECL_DECLARED_CONSTEXPR_P (t))
&& DECL_DECLARED_CONSTEXPR_P (t)) {
{ if (DECL_LANG_SPECIFIC (t) && DECL_DECLARED_CONCEPT_P (t))
if (DECL_DECLARED_CONCEPT_P (t)) pp_cxx_ws_string (pp, "concept");
pp_cxx_ws_string (pp, "concept"); else
else pp_cxx_ws_string (pp, "constexpr");
pp_cxx_ws_string (pp, "constexpr"); }
}
dump_type_prefix (pp, type, flags & ~TFF_UNQUALIFIED_NAME); dump_type_prefix (pp, type, flags & ~TFF_UNQUALIFIED_NAME);
pp_maybe_space (pp); pp_maybe_space (pp);
} }
......
2016-09-16 Jakub Jelinek <jakub@redhat.com> 2016-09-16 Jakub Jelinek <jakub@redhat.com>
PR c++/77482
* g++.dg/cpp0x/constexpr-77482.C: New test.
PR c++/77379 PR c++/77379
* g++.dg/abi/abi-tag23.C: Adjust scan-assembler regex for differing * g++.dg/abi/abi-tag23.C: Adjust scan-assembler regex for differing
thunk offsets. thunk offsets.
......
// 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" }
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