diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
commit | 461a67fa15370a9ec88f8f8a240bf7c123bb2029 (patch) | |
tree | 6942083d7d56bba40ec790a453ca58ad3baf6832 /test/SemaTemplate/cxx17-inline-variables.cpp | |
parent | 75c3240472ba6ac2669ee72ca67eb72d4e2851fc (diff) |
Diffstat (limited to 'test/SemaTemplate/cxx17-inline-variables.cpp')
-rw-r--r-- | test/SemaTemplate/cxx17-inline-variables.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaTemplate/cxx17-inline-variables.cpp b/test/SemaTemplate/cxx17-inline-variables.cpp new file mode 100644 index 0000000000000..9e6761ee57aaf --- /dev/null +++ b/test/SemaTemplate/cxx17-inline-variables.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++17 -verify %s +// expected-no-diagnostics +template<bool> struct DominatorTreeBase { + static constexpr bool IsPostDominator = true; +}; +extern template class DominatorTreeBase<false>; +constexpr bool k = DominatorTreeBase<false>::IsPostDominator; + +namespace CompleteType { + template<unsigned N> constexpr int f(const bool (&)[N]) { return 0; } + + template<bool ...V> struct X { + static constexpr bool arr[] = {V...}; + static constexpr int value = f(arr); + }; + + constexpr int n = X<true>::value; +} |