summaryrefslogtreecommitdiff
path: root/clang/test/SemaTemplate/instantiate-sizeof.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-sizeof.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-sizeof.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-sizeof.cpp b/clang/test/SemaTemplate/instantiate-sizeof.cpp
new file mode 100644
index 0000000..00d63d0
--- /dev/null
+++ b/clang/test/SemaTemplate/instantiate-sizeof.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+
+// Make sure we handle contexts correctly with sizeof
+template<typename T> void f(T n) {
+ int buffer[n];
+ [] { int x = sizeof(sizeof(buffer)); }();
+}
+int main() {
+ f<int>(1);
+}