summaryrefslogtreecommitdiff
path: root/test/SemaTemplate
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-12-14 15:40:16 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-12-14 15:40:16 +0000
commitb007293d31c4fbcd73592302a948fb3bac5d36a7 (patch)
tree797c83196da81daa655d335c5b9ecd3d95dd7c0e /test/SemaTemplate
parent96881be75c9092dabbb19ccae56e64af7ad29e90 (diff)
downloadclang-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.cpp11
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;
+}