From 520a89e9d38bb1c9cc2de3f875eae3ac69f9f08a Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 24 Jan 2018 20:25:37 +0000 Subject: Vendor import of clang release_60 branch r323338: https://llvm.org/svn/llvm-project/cfe/branches/release_60@323338 --- test/SemaTemplate/cxx17-inline-variables.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/SemaTemplate/cxx17-inline-variables.cpp') diff --git a/test/SemaTemplate/cxx17-inline-variables.cpp b/test/SemaTemplate/cxx17-inline-variables.cpp index 9e6761ee57aa..7fc0aa8eeeb0 100644 --- a/test/SemaTemplate/cxx17-inline-variables.cpp +++ b/test/SemaTemplate/cxx17-inline-variables.cpp @@ -16,3 +16,14 @@ namespace CompleteType { constexpr int n = X::value; } + +template struct A { + static const int n; + static const int m; + constexpr int f() { return n; } + constexpr int g() { return n; } +}; +template constexpr int A::n = sizeof(A) + sizeof(T); +template inline constexpr int A::m = sizeof(A) + sizeof(T); +static_assert(A().f() == 5); +static_assert(A().g() == 5); -- cgit v1.3