// Support parsing of concepts
// RUN: %clang_cc1 -std=c++20 -verify %s
concept C1 = true; // expected-note 2{{previous}}
concept C1 = true; // expected-error{{redefinition}}
concept D1 = true;
// expected-error@-1{{expected template parameter}}
// expected-error@-2{{concept template parameter list must have at least one parameter; explicit specialization of concepts is not allowed}}
concept D2 = true;
// expected-error@-1{{expected identifier}}
// expected-error@-2{{template template parameter requires 'class' or 'typename' after the parameter list}}
// expected-error@-3{{concept template parameter list must have at least one parameter; explicit specialization of concepts is not allowed}}
;
extern "C++"
concept C2 = true; // expected-error {{extraneous template parameter list in concept definition}}
concept C3 = true; // expected-note {{previous}} expected-note {{previous}}
int C3; // expected-error {{redefinition}}
; // expected-error {{redefinition}}
; // expected-note{{previous definition is here}}
concept C4 = true;
// expected-error@-1{{redefinition of 'C4' as different kind of symbol}}
// TODO: Add test to prevent explicit specialization, partial specialization
// and explicit instantiation of concepts.
;
using N::C5;
concept C6 = integral_constant<bool, wor>::value;
// expected-error@-1{{use of undeclared identifier 'wor'; did you mean 'word'?}}
// expected-note@-2{{'word' declared here}}
concept bool C7 = true;
// expected-warning@-1{{ISO C++20 does not permit the 'bool' keyword after 'concept'}}
concept C8 = false;
// expected-error@-1{{concept template parameter list must have at least one parameter; explicit specialization of concepts is not allowed}}
concept C7<int> = false;
// expected-error@-1{{name defined in concept definition must be an identifier}}
concept N::C9 = false;
// expected-error@-1{{name defined in concept definition must be an identifier}}
;
// expected-note@-1{{'A' declared here}}
concept A::C10 = false;
// expected-error@-1{{expected namespace name}}
concept operator int = false;
// expected-error@-1{{name defined in concept definition must be an identifier}}
concept C11 = 2; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}}
concept C12 = 2 && x; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}}
concept C13 = x || 2 || x; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}}
concept C14 = 8ull && x || x; // expected-error {{atomic constraint must be of type 'bool' (found 'unsigned long long')}}
concept C15 = sizeof; // expected-error {{atomic constraint must be of type 'bool'}}
concept C16 = true && ; // expected-error {{atomic constraint must be of type 'bool' (found 'int')}}
// expected-warning@-1{{use of logical '&&' with constant operand}}
// expected-note@-2{{use '&' for a bitwise operation}}
// expected-note@-3{{remove constant to silence this warning}}
concept C17 = T;
static_assert;
concept C18 = true;
static_assert;
concept C19 = true;
static_assert;
concept C20 = true;
static_assert;
concept C21 = integral_constant<bool, c>::value && true;
static_assert;
static_assert;
concept C22 = integral_constant<bool, c>::value;
static_assert;
static_assert;
concept C23 = integral_constant<bool, wor>::value;
// expected-error@-1{{use of undeclared identifier 'wor'; did you mean 'word'?}}
// expected-note@-2{{'word' declared here}}