===================================================================
@@ -26108,6 +26112,8 @@ cp_parser_compound_requirement (cp_parser *parser)
return error_mark_node;
}
+ cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
+
return finish_compound_requirement (expr, type, noexcept_p);
}
===================================================================
@@ -6,7 +6,7 @@ concept bool SameAs = __is_same_as(T, U);
template <class T>
concept bool R1 = requires (T& t) {
- { t.begin() } -> T
+ { t.begin() } -> T;
{ t.end() } -> SameAs<T*>;
};
===================================================================
@@ -29,7 +29,7 @@ template <class T> concept bool Movable() {
}
template <class, class> int Swappable_ = requires { 0; };
template <class T, class U> int Swappable();
-template <class T> concept bool Dereferencable = requires{{0}};
+template <class T> concept bool Dereferencable = requires{{0};};
template <Dereferencable R> using RvalueReferenceType = decltype(0);
template <class T> int IsValueType;
template <class> struct value_type;
@@ -39,7 +39,7 @@ requires IsValueType<
_t<value_type<remove_cv_t<T>>>;
template <class I> concept bool Readable() {
return Movable<I>() && DefaultConstructible<I>() &&
- Dereferencable<const I> && requires{{0}};
+ Dereferencable<const I> && requires{{0};};
}
template <class Out, class T> concept bool MoveWritable() {
return Movable<Out>() && DefaultConstructible<Out>() &&
===================================================================
@@ -1,9 +1,9 @@
// { dg-options "-std=c++17 -fconcepts" }
-template <class X> concept bool allocatable = requires{{new X}->X * };
+template <class X> concept bool allocatable = requires{{new X}->X *;};
template <class X> concept bool semiregular = allocatable<X>;
template <class X> concept bool readable = requires{requires semiregular<X>};
-template <class> int weak_input_iterator = requires{{0}->readable};
+template <class> int weak_input_iterator = requires{{0}->readable;};
template <class X> bool input_iterator{weak_input_iterator<X>}; // { dg-warning "narrowing conversion" }
template <class X> bool forward_iterator{input_iterator<X>};
template <class X> bool bidirectional_iterator{forward_iterator<X>};
===================================================================
@@ -0,0 +1,8 @@
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+template<typename T>
+concept bool C = requires(T t) {
+ { +t } // { dg-error "expected .\;. before .\}. token" }
+};
+static_assert(C<int>, "");