summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp/temp.decls
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-08-20 01:44:21 +0000
committerJohn McCall <rjmccall@apple.com>2009-08-20 01:44:21 +0000
commit87a44eb98a28eafad4e28a61fb6f6ff4f2e3c2f1 (patch)
tree9d99e779298ff5b43e5746f0b622b82236f6a6a0 /clang/test/CXX/temp/temp.decls
parent30584ea4a4e787df31234d8bda24f1135e101522 (diff)
downloadbcm5719-llvm-87a44eb98a28eafad4e28a61fb6f6ff4f2e3c2f1.tar.gz
bcm5719-llvm-87a44eb98a28eafad4e28a61fb6f6ff4f2e3c2f1.zip
Basic nested-template implementation.
llvm-svn: 79504
Diffstat (limited to 'clang/test/CXX/temp/temp.decls')
-rw-r--r--clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp b/clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp
new file mode 100644
index 00000000000..80b18467a36
--- /dev/null
+++ b/clang/test/CXX/temp/temp.decls/temp.mem/p1.cpp
@@ -0,0 +1,16 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+template <class T> struct A {
+ static T cond;
+
+ template <class U> struct B {
+ static T twice(U value) {
+ return (cond ? value + value : value);
+ }
+ };
+};
+
+int foo() {
+ A<bool>::cond = true;
+ return A<bool>::B<int>::twice(4);
+}
OpenPOWER on IntegriCloud