summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/warn-thread-safety-parsing.cpp')
-rw-r--r--clang/test/SemaCXX/warn-thread-safety-parsing.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-thread-safety-parsing.cpp b/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
index 6eacc761d55..c58ff9314ec 100644
--- a/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
@@ -1262,3 +1262,30 @@ class __attribute__((lockable)) EmptyArgListsTest {
void unlock() __attribute__((unlock_function())) { }
};
+
+namespace FunctionDefinitionParseTest {
+// Test parsing of attributes on function definitions.
+
+class Foo {
+public:
+ Mu mu_;
+ void foo1();
+ void foo2(Foo *f);
+};
+
+template <class T>
+class Bar {
+public:
+ Mu mu_;
+ void bar();
+};
+
+void Foo::foo1() __attribute__((exclusive_locks_required(mu_))) { }
+void Foo::foo2(Foo *f) __attribute__((exclusive_locks_required(f->mu_))) { }
+
+template <class T>
+void Bar<T>::bar() __attribute__((exclusive_locks_required(mu_))) { }
+
+void baz(Foo *f) __attribute__((exclusive_locks_required(f->mu_))) { }
+};
+
OpenPOWER on IntegriCloud