diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-14 15:40:16 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-14 15:40:16 +0000 |
commit | b007293d31c4fbcd73592302a948fb3bac5d36a7 (patch) | |
tree | 797c83196da81daa655d335c5b9ecd3d95dd7c0e /test/SemaTemplate | |
parent | 96881be75c9092dabbb19ccae56e64af7ad29e90 (diff) | |
download | clang-b007293d31c4fbcd73592302a948fb3bac5d36a7.tar.gz |
When attempting to complete an incomplete array bound type in an expression,
update the type from the definition even if we didn't instantiate a definition.
We may have instantiated the definition in an earlier stage of semantic
analysis, after creating the DeclRefExpr but before we reach a point where a
complete expression type is required.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r-- | test/SemaTemplate/cxx17-inline-variables.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaTemplate/cxx17-inline-variables.cpp b/test/SemaTemplate/cxx17-inline-variables.cpp index c0180506be..9e6761ee57 100644 --- a/test/SemaTemplate/cxx17-inline-variables.cpp +++ b/test/SemaTemplate/cxx17-inline-variables.cpp @@ -5,3 +5,14 @@ template<bool> struct DominatorTreeBase { }; 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; +} |