diff options
Diffstat (limited to 'clang/test/SemaCXX/warn-thread-safety-analysis.cpp')
-rw-r--r-- | clang/test/SemaCXX/warn-thread-safety-analysis.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-thread-safety-analysis.cpp b/clang/test/SemaCXX/warn-thread-safety-analysis.cpp index e8b7e9fb150..831c26ca3b2 100644 --- a/clang/test/SemaCXX/warn-thread-safety-analysis.cpp +++ b/clang/test/SemaCXX/warn-thread-safety-analysis.cpp @@ -265,3 +265,33 @@ void aa_fun_bad_3() { glock.globalLock(); // \ expected-warning {{lock 'aa_mu' is not released at the end of function 'aa_fun_bad_3'}} } + + +//--------------------------------------------------// +// Regression tests for unusual method names +//--------------------------------------------------// + +Mutex wmu; + +// Test diagnostics for other method names. +class WeirdMethods { + WeirdMethods() { + wmu.Lock(); // \ + expected-warning {{lock 'wmu' is not released at the end of function 'WeirdMethods'}} + } + ~WeirdMethods() { + wmu.Lock(); // \ + expected-warning {{lock 'wmu' is not released at the end of function '~WeirdMethods'}} + } + void operator++() { + wmu.Lock(); // \ + expected-warning {{lock 'wmu' is not released at the end of function 'operator++'}} + } + operator int*() { + wmu.Lock(); // \ + expected-warning {{lock 'wmu' is not released at the end of function 'operator int *'}} + return 0; + } +}; + + |