From 4c05f1427134a524e1c84ccd57f59a96ffdffe59 Mon Sep 17 00:00:00 2001 From: Aleksei Sidorin Date: Wed, 14 Feb 2018 11:18:00 +0000 Subject: [ASTImporter] Fix lexical DC for templated decls; support VarTemplatePartialSpecDecl Also minor refactoring in related functions was done. Differential Revision: https://reviews.llvm.org/D43012 llvm-svn: 325116 --- clang/test/ASTMerge/var-cpp/Inputs/var1.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 clang/test/ASTMerge/var-cpp/Inputs/var1.cpp (limited to 'clang/test/ASTMerge/var-cpp/Inputs') diff --git a/clang/test/ASTMerge/var-cpp/Inputs/var1.cpp b/clang/test/ASTMerge/var-cpp/Inputs/var1.cpp new file mode 100644 index 00000000000..e29db9d43fb --- /dev/null +++ b/clang/test/ASTMerge/var-cpp/Inputs/var1.cpp @@ -0,0 +1,17 @@ + +template +constexpr T my_pi = T(3.1415926535897932385L); // variable template + +template <> constexpr char my_pi = '3'; // variable template specialization + +template +struct Wrapper { + template static constexpr U my_const = U(1); + // Variable template partial specialization with member variable. + template static constexpr U *my_const = (U *)(0); +}; + +constexpr char a[] = "hello"; + +template <> template <> +constexpr const char *Wrapper::my_const = a; -- cgit v1.2.3