summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/cxx17-inline-variables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/cxx17-inline-variables.cpp')
-rw-r--r--test/SemaTemplate/cxx17-inline-variables.cpp18
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;
+}