summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx-concept-declaration.cpp
blob: 6bc2d482dcbe6ec325d534ee37dbff47e7ff0f0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN:  %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s

namespace A {
  template<typename T> concept bool C1() { return true; }

  template<typename T> concept bool C2 = true;
}

template<typename T> concept bool D1(); // expected-error {{function concept declaration must be a definition}}

struct B {
  template<typename T> concept bool D2() { return true; } // expected-error {{concept declarations may only appear in namespace scope}}
};

struct C {
  template<typename T> static concept bool D3 = true; // expected-error {{concept declarations may only appear in namespace scope}}
};
OpenPOWER on IntegriCloud