+2016-03-08 Jason Merrill <jason@redhat.com>
+
+ * c-opts.c (set_std_cxx1z): Don't enable concepts.
+
2016-03-04 David Malcolm <dmalcolm@redhat.com>
PR c/68187
/* C++11 includes the C99 standard library. */
flag_isoc94 = 1;
flag_isoc99 = 1;
- /* Enable concepts by default. */
- flag_concepts = 1;
flag_isoc11 = 1;
cxx_dialect = cxx1z;
lang_hooks.name = "GNU C++14"; /* Pretend C++14 till standarization. */
2016-03-08 Jason Merrill <jason@redhat.com>
+ * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
+ diagnostic for use of "concept".
+ (cp_parser_requires_clause_opt): And "requires".
+ (cp_parser_type_parameter, cp_parser_late_return_type_opt)
+ (cp_parser_explicit_template_declaration): Adjust.
+ * Make-lang.in (check-c++-all): Add "concepts" to std list.
+
P0036R0: Unary Folds and Empty Parameter Packs
* pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
# Run the testsuite in all standard conformance levels.
check-c++-all:
- $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --stds=98,11,14,1z" check-g++
+ $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --stds=98,11,14,1z,concepts" check-g++
# Run the testsuite with garbage collection at every opportunity.
check-g++-strict-gc:
&& !strcmp (IDENTIFIER_POINTER (id), "thread_local"))
inform (location, "C++11 %<thread_local%> only available with "
"-std=c++11 or -std=gnu++11");
+ else if (!flag_concepts && id == ridpointers[(int)RID_CONCEPT])
+ inform (location, "%<concept%> only available with -fconcepts");
else if (processing_template_decl && current_class_type
&& TYPE_BINFO (current_class_type))
{
cp_parser_require (parser, CPP_GREATER, RT_GREATER);
// If template requirements are present, parse them.
- if (flag_concepts)
- {
- tree reqs = get_shorthand_constraints (current_template_parms);
- if (tree r = cp_parser_requires_clause_opt (parser))
- reqs = conjoin_constraints (reqs, make_predicate_constraint (r));
- TEMPLATE_PARMS_CONSTRAINTS (current_template_parms) = reqs;
- }
+ tree reqs = get_shorthand_constraints (current_template_parms);
+ if (tree r = cp_parser_requires_clause_opt (parser))
+ reqs = conjoin_constraints (reqs, make_predicate_constraint (r));
+ TEMPLATE_PARMS_CONSTRAINTS (current_template_parms) = reqs;
/* Look for the `class' or 'typename' keywords. */
cp_parser_type_parameter_key (parser);
/* A late-specified return type is indicated by an initial '->'. */
if (token->type != CPP_DEREF
&& token->keyword != RID_REQUIRES
+ && !(token->type == CPP_NAME
+ && token->u.value == ridpointers[RID_REQUIRES])
&& !(declare_simd_p || cilk_simd_fn_vector_p || oacc_routine_p))
return NULL_TREE;
static tree
cp_parser_requires_clause_opt (cp_parser *parser)
{
- if (!cp_lexer_next_token_is_keyword (parser->lexer, RID_REQUIRES))
- return NULL_TREE;
+ cp_token *tok = cp_lexer_peek_token (parser->lexer);
+ if (tok->keyword != RID_REQUIRES)
+ {
+ if (!flag_concepts && tok->type == CPP_NAME
+ && tok->u.value == ridpointers[RID_REQUIRES])
+ {
+ error_at (cp_lexer_peek_token (parser->lexer)->location,
+ "%<requires%> only available with -fconcepts");
+ /* Parse and discard the requires-clause. */
+ cp_lexer_consume_token (parser->lexer);
+ cp_parser_requires_clause (parser);
+ }
+ return NULL_TREE;
+ }
cp_lexer_consume_token (parser->lexer);
return cp_parser_requires_clause (parser);
}
cp_parser_skip_to_end_of_template_parameter_list (parser);
/* Manage template requirements */
- if (flag_concepts)
- {
- tree reqs = get_shorthand_constraints (current_template_parms);
- if (tree r = cp_parser_requires_clause_opt (parser))
- reqs = conjoin_constraints (reqs, make_predicate_constraint (r));
- TEMPLATE_PARMS_CONSTRAINTS (current_template_parms) = reqs;
- }
+ tree reqs = get_shorthand_constraints (current_template_parms);
+ if (tree r = cp_parser_requires_clause_opt (parser))
+ reqs = conjoin_constraints (reqs, make_predicate_constraint (r));
+ TEMPLATE_PARMS_CONSTRAINTS (current_template_parms) = reqs;
cp_parser_template_declaration_after_parameters (parser, parameter_list,
member_p);
exhaustion is signalled by throwing @code{std::bad_alloc}. See also
@samp{new (nothrow)}.
+@item -fconcepts
+@opindex fconcepts
+Enable support for the C++ Extensions for Concepts Technical
+Specification, ISO 19217 (2015), which allows code like
+
+@smallexample
+template <class T> concept bool Addable = requires (T t) @{ t + t; @};
+template <Addable T> T add (T a, T b) @{ return a + b; @}
+@end smallexample
+
@item -fconstexpr-depth=@var{n}
@opindex fconstexpr-depth
Set the maximum nested evaluation depth for C++11 constexpr functions
+2016-03-08 Jason Merrill <jason@redhat.com>
+
+ * lib/g++-dg.exp (g++-dg-runtest): Handle "concepts" in std list.
+ * lib/target-supports.exp (check_effective_target_concepts): New.
+
2016-03-08 Jakub Jelinek <jakub@redhat.com>
PR c++/70135
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T1, class T2> class A { };
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class...> class tuple {};
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Class() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Class() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool One() { return sizeof(T) >= 4; }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool One() { return sizeof(T) >= 4; }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
typedef concept int CINT; // { dg-error "'concept' cannot appear in a typedef declaration" }
// PR c++/67007
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class U>
concept bool A =
// PR c++/67159
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T>
concept bool R = requires (T& t) {
// PR c++/66962
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <typename> struct remove_cv;
template <typename> struct is_reference;
// PR c++/66092
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <type_traits>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Check equivalence of short- and longhand declarations.
// { dg-do run }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// template<typename T>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
// { dg-do run }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <cassert>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
// { dg-do run }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <cassert>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <cassert>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
struct A {
// { dg-do run }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <cassert>
#include <iostream>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1()
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C()
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
#ifndef __cpp_concepts
#error __cpp_concepts not defined
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Tuple() { // { dg-error "multiple statements" }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept auto C1() { return 0; } // { dg-error "deduced return type" }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
// { dg-do compile }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Test that constraint satisfaction checks work even when
// processing template declarations.
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
// { dg-do run }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <cassert>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Check shorthand notation.
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Redefinition errors.
// { dg-do link }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// FIXME: What is this actually testing?
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Class() { return __is_class(T); }
// { dg-do run }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <cassert>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Eq() { return requires(T t) { t == t; }; }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Eq() { return requires(T t) { t == t; }; }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
// { dg-do run }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <cassert>
#include <type_traits>
// PR c++/67240
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
int foo(int x)
{
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C = __is_class(T);
// { dg-do run }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <cassert>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename ... T>
concept bool C1 = true;
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename ... T>
concept bool C1 = true;
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T, typename U = int>
concept bool C()
// PR c++/67003
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
namespace X {
template<class>
// PR c++/66985
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <template <class> class T>
concept bool _Valid = requires { typename T<int>; };
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
struct Base {
template<typename T>
// { dg-do run}
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
// { dg-do run}
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <cassert>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Type() { return true; }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Make sure that we check partial concept ids
// with variable concepts.
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Check that constraints don't break unconstrained partial
// specializations.
// PR c++/67084
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T>
constexpr bool p = false;
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T> struct A { };
template <class T> requires false struct A<T*> { };
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T> concept bool is_int = __is_same_as(T,int);
// PR c++/67138
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T>
concept bool _Auto = true;
// PR c++/67152
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T>
concept bool HasType = requires { typename T::type; };
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T, typename U>
struct is_same
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Check argument deduction constraints.
// TODO: We shoul have more of these...
// PR c++/66218
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T, class U>
concept bool Same = __is_same_as(T, U);
// PR c++/66218
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T, class U>
concept bool Same = __is_same_as(T, U);
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T, class U>
concept bool Same = __is_same_as(T, U);
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <int I> struct B { static const int i = I; };
template <int I> concept bool Few = I < 10;
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Concept() {
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C = false;
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1() {
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
using TD = int;
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C()
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Performance test... This should be fast.
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Handle alias templates in type requirements.
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1()
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<class T> concept bool C1 = true;
template<class A, class B> struct Pair {};
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class>
concept bool C1 () {
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <typename, typename>
struct is_same {
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
void f1(int a) requires true; // OK
auto f2(int a) -> bool requires true; // OK
// { dg-do compile }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Class () { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Test that standard conversions are checked with
// implicit conversion constraints.
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Check that we can evaluate constant requires-expressions
// as constant expressions, for the curious case when they
// PR c++/66218
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <type_traits>
// PR c++/66758
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T, class...Args>
concept bool Constructible =
// PR c++/66758
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T, class U>
concept bool C = requires (T t, U u) { t + u; };
// PR c++/66832
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T, class U, unsigned N>
requires requires (T& t, U &u) { t.foo(); u.foo(); }
// PR c++/66988
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <type_traits>
// PR c++/67018
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <typename T>
constexpr bool Val = true;
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class> struct all_same {
static constexpr bool value = 1;
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Class () { return __is_class(T); }
// { dg-do run }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Class () { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
struct fool {
constexpr fool operator&&(fool) const { return {}; }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
struct fool { };
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
struct X { };
int operator==(X, X) { return 0; }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
#include <vector>
// { dg-do compile }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
// Check that type requirements are normalized correctly.
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
struct S1 {};
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1 = __is_same_as(T, int);
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<int N, class T>
concept bool P() { return true; }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool NameProvider()
// Conceptized version of template/ttp23.C
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T> concept bool Foo = true;
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1 = __is_same_as(T, int);
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1 = __is_same_as(T, int);
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1 = __is_same_as(T, int);
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1 = __is_same_as(T, int);
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename... Ts> struct are_same;
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename... Ts> struct are_same;
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
// PR c++/66937
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
#include <tuple>
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Nothrow_assignable() { return __has_nothrow_assign(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool Nothrow_assignable() { return __has_nothrow_assign(T); }
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1 = __is_class(T);
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1 = __is_class(T);
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T>
concept bool C1 = __is_class(T);
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T, typename U>
concept bool Same = __is_same_as(T, U);
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template<typename T1, typename T2>
concept bool C1 = true;
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T>
concept int C = true; // { dg-error "bool" }
// PR c++/67117
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T>
requires false
// PR c++/67139
-// { dg-options -std=c++1z }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T>
constexpr typename T::type::value_type _v = T::type::value;
// PR c++/66712
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T, class...Args>
concept bool _Constructible_ =
-// { dg-options "-std=c++1z" }
+// { dg-options "-std=c++1z -fconcepts" }
template <class T> concept bool Copyable = requires (T t) { T(t); };
template <class T> concept bool Constructable = requires { T(); };
A<int> A1;
// CWG issue 625
-A<auto> A2 = A1; // { dg-error "" "" { target { ! c++1z } } }
+A<auto> A2 = A1; // { dg-error "" "" { target { ! concepts } } }
auto foo() { } // { dg-error "auto" "" { target { ! c++14 } } }
-void bar(auto i) // { dg-error "incomplete|auto" "" { target { ! c++1z } } }
+void bar(auto i) // { dg-error "incomplete|auto" "" { target { ! concepts } } }
{
(void)i;
}
template <typename T> struct H { H (); ~H (); };
H<auto> h; // { dg-error "invalid|initializer" }
-void qq (auto); // { dg-error "auto" "" { target { ! c++1z } } }
-void qr (auto*); // { dg-error "auto" "" { target { ! c++1z } } }
+void qq (auto); // { dg-error "auto" "" { target { ! concepts } } }
+void qr (auto*); // { dg-error "auto" "" { target { ! concepts } } }
// PR c++/46145
typedef auto autot; // { dg-error "auto" }
}
set option_list { }
foreach x $std_list {
+ # Handle "concepts" as C++1z plus Concepts TS.
+ if { $x eq "concepts" } then { set x "1z -fconcepts" }
lappend option_list "${std_prefix}$x"
}
} else {
return [check_effective_target_c++1z_only]
}
+# Check for C++ Concepts TS support, i.e. -fconcepts flag.
+proc check_effective_target_concepts { } {
+ return [check-flags { "" { } { -fconcepts } }]
+}
+
# Return 1 if expensive testcases should be run.
proc check_effective_target_run_expensive_tests { } {