Clang Project

clang_source_code/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p7.cpp
1// RUN:  %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s
2
3template <typename T> concept bool FCEI() { return true; } // expected-note {{previous declaration is here}} expected-note {{previous declaration is here}}
4template bool FCEI<int>(); // expected-error {{function concept cannot be explicitly instantiated}}
5extern template bool FCEI<double>(); // expected-error {{function concept cannot be explicitly instantiated}}
6
7template <typename T> concept bool FCES() { return true; } // expected-note {{previous declaration is here}}
8template <> bool FCES<int>() { return true; } // expected-error {{function concept cannot be explicitly specialized}}
9
10template <typename T> concept bool VC { true }; // expected-note {{previous declaration is here}} expected-note {{previous declaration is here}}
11template bool VC<int>; // expected-error {{variable concept cannot be explicitly instantiated}}
12extern template bool VC<double>; // expected-error {{variable concept cannot be explicitly instantiated}}
13
14template <typename T> concept bool VCES { true }; // expected-note {{previous declaration is here}}
15template <> bool VCES<int> { true }; // expected-error {{variable concept cannot be explicitly specialized}}
16
17template <typename T> concept bool VCPS { true }; // expected-note {{previous declaration is here}}
18template <typename T> bool VCPS<T *> { true }; // expected-error {{variable concept cannot be partially specialized}}
19