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 | 2faf8e127f314d1beeadff277ba6f95eeee951d0 (patch) | |
tree | 61141880c44c5ea82e1a64691e31ae0396b19ca1 /clang/test/SemaTemplate/cxx17-inline-variables.cpp | |
parent | 12cdb4fd330e15586b52c14bb89d6a97d287fb25 (diff) | |
download | bcm5719-llvm-2faf8e127f314d1beeadff277ba6f95eeee951d0.tar.gz bcm5719-llvm-2faf8e127f314d1beeadff277ba6f95eeee951d0.zip |
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.
llvm-svn: 320709
Diffstat (limited to 'clang/test/SemaTemplate/cxx17-inline-variables.cpp')
-rw-r--r-- | clang/test/SemaTemplate/cxx17-inline-variables.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/cxx17-inline-variables.cpp b/clang/test/SemaTemplate/cxx17-inline-variables.cpp index c0180506beb..9e6761ee57a 100644 --- a/clang/test/SemaTemplate/cxx17-inline-variables.cpp +++ b/clang/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; +} |