]> granicus.if.org Git - clang/commitdiff
Test case for rdar://problem/11055105, a bug with the instantiation
authorJohn McCall <rjmccall@apple.com>
Wed, 21 Mar 2012 00:45:33 +0000 (00:45 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 21 Mar 2012 00:45:33 +0000 (00:45 +0000)
of references to function template parameters in noexcept clauses when
the instantiation is forced from a point during parsing when a block
is in scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153152 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/blocks-1.cpp

index 29de1e666ad75931714247b8c3c9145f238d6bc1..1b1509482af354af0b983f57e6c07a8403d8f877 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks
+// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks -std=c++11
 
 extern "C" int exit(int);
 
@@ -43,3 +43,16 @@ namespace rdar8134521 {
     P = (int(^)(int))((void*)1);
   }
 }
+
+namespace rdar11055105 {
+  struct A {
+    void foo();
+  };
+
+  template <class T> void foo(T &x) noexcept(noexcept(x.foo()));
+
+  void (^block)() = ^{
+    A a;
+    foo(a);
+  };
+}