diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-10-18 22:45:01 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-10-18 22:45:01 +0000 |
commit | 7d9b7a95bc7c0a26db6dd16d494b3497b16feb32 (patch) | |
tree | ffe232c41b9160769a2a4cda43c805704a8f7105 /test/SemaTemplate/cxx17-inline-variables.cpp | |
parent | b5f76b264eddfb946c41aa9b2b166d2fda585c3b (diff) | |
download | clang-7d9b7a95bc7c0a26db6dd16d494b3497b16feb32.tar.gz |
Don't suppress instantiation of definitions for variables subject to explicit
instantiation declarations if they are usable from constant expressions.
We are permitted to instantiate in these cases, and required to do so in order
to have an initializer available for use within constant evaluation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316136 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/cxx17-inline-variables.cpp')
-rw-r--r-- | test/SemaTemplate/cxx17-inline-variables.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaTemplate/cxx17-inline-variables.cpp b/test/SemaTemplate/cxx17-inline-variables.cpp new file mode 100644 index 0000000000..c0180506be --- /dev/null +++ b/test/SemaTemplate/cxx17-inline-variables.cpp @@ -0,0 +1,7 @@ +// 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; |