[clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::inferFrameworkModule()
[llvm-project.git] / clang / test / SemaTemplate / cxx17-inline-variables.cpp
blob7fc0aa8eeeb0c40aa16a2b645b3d277ecb69fe94
1 // RUN: %clang_cc1 -std=c++17 -verify %s
2 // expected-no-diagnostics
3 template<bool> struct DominatorTreeBase {
4 static constexpr bool IsPostDominator = true;
5 };
6 extern template class DominatorTreeBase<false>;
7 constexpr bool k = DominatorTreeBase<false>::IsPostDominator;
9 namespace CompleteType {
10 template<unsigned N> constexpr int f(const bool (&)[N]) { return 0; }
12 template<bool ...V> struct X {
13 static constexpr bool arr[] = {V...};
14 static constexpr int value = f(arr);
17 constexpr int n = X<true>::value;
20 template <typename T> struct A {
21 static const int n;
22 static const int m;
23 constexpr int f() { return n; }
24 constexpr int g() { return n; }
26 template <typename T> constexpr int A<T>::n = sizeof(A) + sizeof(T);
27 template <typename T> inline constexpr int A<T>::m = sizeof(A) + sizeof(T);
28 static_assert(A<int>().f() == 5);
29 static_assert(A<int>().g() == 5);