+2020-02-12 Patrick Palka <ppalka@redhat.com>
+
+ * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
+ (dump_simple_decl): Handle standard concept definitions as well as
+ variable concept definitions.
+
2020-02-10 Jakub Jelinek <jakub@redhat.com>
PR other/93641
if (flags & TFF_DECL_SPECIFIERS)
{
- 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);
+ if (concept_definition_p (t))
+ pp_cxx_ws_string (pp, "concept");
+ else if (VAR_P (t) && DECL_DECLARED_CONSTEXPR_P (t))
+ pp_cxx_ws_string (pp, "constexpr");
+
+ if (!standard_concept_p (t))
+ dump_type_prefix (pp, type, flags & ~TFF_UNQUALIFIED_NAME);
pp_maybe_space (pp);
}
if (! (flags & TFF_UNQUALIFIED_NAME)
break;
case CONCEPT_DECL:
- pp_cxx_ws_string (pp, "concept");
- dump_decl_name (pp, DECL_NAME (t), flags);
+ dump_simple_decl (pp, t, TREE_TYPE (t), flags);
break;
case WILDCARD_DECL:
--- /dev/null
+// { dg-do compile { target c++2a } }
+
+namespace a
+{
+ template<typename = int>
+ concept b = true; // { dg-message ".a::b. declared here" }
+}
+
+static_assert(b); // { dg-error "did you mean .a::b." }
+
+namespace c
+{
+ template<typename>
+ concept b = true; // { dg-message "concept c::b." }
+
+ template<typename>
+ concept b = true; // { dg-error "concept c::b." }
+}