summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-non-type-template-parameter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-31 17:21:17 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-31 17:21:17 +0000
commit550d9b28fd586db541eb6dd36f3c10d114e483d8 (patch)
treeb01023c9c5330b297f5388de6ac1a22dadc028b1 /test/SemaTemplate/instantiate-non-type-template-parameter.cpp
parentdf7c3b955e31a6951822f2adf36e98543ef14c7e (diff)
downloadclang-550d9b28fd586db541eb6dd36f3c10d114e483d8.tar.gz
clang-550d9b28fd586db541eb6dd36f3c10d114e483d8.tar.bz2
clang-550d9b28fd586db541eb6dd36f3c10d114e483d8.tar.xz
Implement "incremental" template instantiation for non-type template
parameters and template type parameters, which occurs when substituting into the declarations of member templates inside class templates. This eliminates errors about our inability to "reduce non-type template parameter depth", fixing PR5311. Also fixes a bug when instantiating a template type parameter declaration in a member template, where we weren't properly reducing the template parameter's depth. LLVM's StringSwitch header now parses. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-non-type-template-parameter.cpp')
-rw-r--r--test/SemaTemplate/instantiate-non-type-template-parameter.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-non-type-template-parameter.cpp b/test/SemaTemplate/instantiate-non-type-template-parameter.cpp
new file mode 100644
index 0000000000..32acbd0d8b
--- /dev/null
+++ b/test/SemaTemplate/instantiate-non-type-template-parameter.cpp
@@ -0,0 +1,14 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// PR5311
+template<typename T>
+class StringSwitch {
+public:
+ template<unsigned N>
+ void Case(const char (&S)[N], const int & Value) {
+ }
+};
+
+int main(int argc, char *argv[]) {
+ (void)StringSwitch<int>();
+}