summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/Basic/Attr.td30
-rw-r--r--clang/test/SemaCXX/attr-no-sanitize-address.cpp10
-rw-r--r--clang/test/SemaCXX/attr-no-sanitize-memory.cpp10
-rw-r--r--clang/test/SemaCXX/attr-no-sanitize-thread.cpp10
-rw-r--r--clang/test/SemaCXX/warn-thread-safety-parsing.cpp100
-rw-r--r--clang/utils/TableGen/ClangAttrEmitter.cpp9
6 files changed, 83 insertions, 86 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index a243994e202..e054d6a8fb9 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -1262,21 +1262,21 @@ def X86ForceAlignArgPointer : InheritableAttr, TargetSpecificAttr<TargetX86> {
def NoSanitizeAddress : InheritableAttr {
let Spellings = [GCC<"no_address_safety_analysis">,
GCC<"no_sanitize_address">];
- let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
+ let Subjects = SubjectList<[Function], ErrorDiag>;
let Documentation = [NoSanitizeAddressDocs];
}
// Attribute to disable ThreadSanitizer checks.
def NoSanitizeThread : InheritableAttr {
let Spellings = [GNU<"no_sanitize_thread">];
- let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
+ let Subjects = SubjectList<[Function], ErrorDiag>;
let Documentation = [NoSanitizeThreadDocs];
}
// Attribute to disable MemorySanitizer checks.
def NoSanitizeMemory : InheritableAttr {
let Spellings = [GNU<"no_sanitize_memory">];
- let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
+ let Subjects = SubjectList<[Function], ErrorDiag>;
let Documentation = [NoSanitizeMemoryDocs];
}
@@ -1331,7 +1331,7 @@ def AssertCapability : InheritableAttr {
CXX11<"clang", "assert_capability">,
GNU<"assert_shared_capability">,
CXX11<"clang", "assert_shared_capability">];
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let LateParsed = 1;
let TemplateDependent = 1;
let ParseArgumentsAsUnevaluated = 1;
@@ -1350,7 +1350,7 @@ def AcquireCapability : InheritableAttr {
CXX11<"clang", "acquire_shared_capability">,
GNU<"exclusive_lock_function">,
GNU<"shared_lock_function">];
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let LateParsed = 1;
let TemplateDependent = 1;
let ParseArgumentsAsUnevaluated = 1;
@@ -1368,7 +1368,7 @@ def TryAcquireCapability : InheritableAttr {
CXX11<"clang", "try_acquire_capability">,
GNU<"try_acquire_shared_capability">,
CXX11<"clang", "try_acquire_shared_capability">];
- let Subjects = SubjectList<[Function, FunctionTemplate],
+ let Subjects = SubjectList<[Function],
ErrorDiag>;
let LateParsed = 1;
let TemplateDependent = 1;
@@ -1389,7 +1389,7 @@ def ReleaseCapability : InheritableAttr {
GNU<"release_generic_capability">,
CXX11<"clang", "release_generic_capability">,
GNU<"unlock_function">];
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let LateParsed = 1;
let TemplateDependent = 1;
let ParseArgumentsAsUnevaluated = 1;
@@ -1417,7 +1417,7 @@ def RequiresCapability : InheritableAttr {
let TemplateDependent = 1;
let ParseArgumentsAsUnevaluated = 1;
let DuplicatesAllowedWhileMerging = 1;
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let Accessors = [Accessor<"isShared", [GNU<"requires_shared_capability">,
GNU<"shared_locks_required">,
CXX11<"clang","requires_shared_capability">]>];
@@ -1426,7 +1426,7 @@ def RequiresCapability : InheritableAttr {
def NoThreadSafetyAnalysis : InheritableAttr {
let Spellings = [GNU<"no_thread_safety_analysis">];
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let Documentation = [Undocumented];
}
@@ -1485,7 +1485,7 @@ def AssertExclusiveLock : InheritableAttr {
let TemplateDependent = 1;
let ParseArgumentsAsUnevaluated = 1;
let DuplicatesAllowedWhileMerging = 1;
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let Documentation = [Undocumented];
}
@@ -1496,7 +1496,7 @@ def AssertSharedLock : InheritableAttr {
let TemplateDependent = 1;
let ParseArgumentsAsUnevaluated = 1;
let DuplicatesAllowedWhileMerging = 1;
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let Documentation = [Undocumented];
}
@@ -1509,7 +1509,7 @@ def ExclusiveTrylockFunction : InheritableAttr {
let TemplateDependent = 1;
let ParseArgumentsAsUnevaluated = 1;
let DuplicatesAllowedWhileMerging = 1;
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let Documentation = [Undocumented];
}
@@ -1522,7 +1522,7 @@ def SharedTrylockFunction : InheritableAttr {
let TemplateDependent = 1;
let ParseArgumentsAsUnevaluated = 1;
let DuplicatesAllowedWhileMerging = 1;
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let Documentation = [Undocumented];
}
@@ -1532,7 +1532,7 @@ def LockReturned : InheritableAttr {
let LateParsed = 1;
let TemplateDependent = 1;
let ParseArgumentsAsUnevaluated = 1;
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let Documentation = [Undocumented];
}
@@ -1543,7 +1543,7 @@ def LocksExcluded : InheritableAttr {
let TemplateDependent = 1;
let ParseArgumentsAsUnevaluated = 1;
let DuplicatesAllowedWhileMerging = 1;
- let Subjects = SubjectList<[Function, FunctionTemplate]>;
+ let Subjects = SubjectList<[Function]>;
let Documentation = [Undocumented];
}
diff --git a/clang/test/SemaCXX/attr-no-sanitize-address.cpp b/clang/test/SemaCXX/attr-no-sanitize-address.cpp
index f1803496fa5..9ca28630552 100644
--- a/clang/test/SemaCXX/attr-no-sanitize-address.cpp
+++ b/clang/test/SemaCXX/attr-no-sanitize-address.cpp
@@ -15,23 +15,23 @@ int noanal_testfn(int y) NO_SANITIZE_ADDRESS;
int noanal_testfn(int y) {
int x NO_SANITIZE_ADDRESS = y; // \
- // expected-error {{'no_sanitize_address' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_address' attribute only applies to functions}}
return x;
}
int noanal_test_var NO_SANITIZE_ADDRESS; // \
- // expected-error {{'no_sanitize_address' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_address' attribute only applies to functions}}
class NoanalFoo {
private:
int test_field NO_SANITIZE_ADDRESS; // \
- // expected-error {{'no_sanitize_address' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_address' attribute only applies to functions}}
void test_method() NO_SANITIZE_ADDRESS;
};
class NO_SANITIZE_ADDRESS NoanalTestClass { // \
- // expected-error {{'no_sanitize_address' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_address' attribute only applies to functions}}
};
void noanal_fun_params(int lvar NO_SANITIZE_ADDRESS); // \
- // expected-error {{'no_sanitize_address' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_address' attribute only applies to functions}}
diff --git a/clang/test/SemaCXX/attr-no-sanitize-memory.cpp b/clang/test/SemaCXX/attr-no-sanitize-memory.cpp
index d6eca1b69dc..9cbcb03d6ec 100644
--- a/clang/test/SemaCXX/attr-no-sanitize-memory.cpp
+++ b/clang/test/SemaCXX/attr-no-sanitize-memory.cpp
@@ -15,23 +15,23 @@ int noanal_testfn(int y) NO_SANITIZE_MEMORY;
int noanal_testfn(int y) {
int x NO_SANITIZE_MEMORY = y; // \
- // expected-error {{'no_sanitize_memory' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_memory' attribute only applies to functions}}
return x;
}
int noanal_test_var NO_SANITIZE_MEMORY; // \
- // expected-error {{'no_sanitize_memory' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_memory' attribute only applies to functions}}
class NoanalFoo {
private:
int test_field NO_SANITIZE_MEMORY; // \
- // expected-error {{'no_sanitize_memory' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_memory' attribute only applies to functions}}
void test_method() NO_SANITIZE_MEMORY;
};
class NO_SANITIZE_MEMORY NoanalTestClass { // \
- // expected-error {{'no_sanitize_memory' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_memory' attribute only applies to functions}}
};
void noanal_fun_params(int lvar NO_SANITIZE_MEMORY); // \
- // expected-error {{'no_sanitize_memory' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_memory' attribute only applies to functions}}
diff --git a/clang/test/SemaCXX/attr-no-sanitize-thread.cpp b/clang/test/SemaCXX/attr-no-sanitize-thread.cpp
index d6372bceff8..6cb9c715bf6 100644
--- a/clang/test/SemaCXX/attr-no-sanitize-thread.cpp
+++ b/clang/test/SemaCXX/attr-no-sanitize-thread.cpp
@@ -15,23 +15,23 @@ int noanal_testfn(int y) NO_SANITIZE_THREAD;
int noanal_testfn(int y) {
int x NO_SANITIZE_THREAD = y; // \
- // expected-error {{'no_sanitize_thread' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
return x;
}
int noanal_test_var NO_SANITIZE_THREAD; // \
- // expected-error {{'no_sanitize_thread' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
class NoanalFoo {
private:
int test_field NO_SANITIZE_THREAD; // \
- // expected-error {{'no_sanitize_thread' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
void test_method() NO_SANITIZE_THREAD;
};
class NO_SANITIZE_THREAD NoanalTestClass { // \
- // expected-error {{'no_sanitize_thread' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
};
void noanal_fun_params(int lvar NO_SANITIZE_THREAD); // \
- // expected-error {{'no_sanitize_thread' attribute only applies to functions and methods}}
+ // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
diff --git a/clang/test/SemaCXX/warn-thread-safety-parsing.cpp b/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
index 6d4ad39c0c9..6f9e7de4176 100644
--- a/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
@@ -109,26 +109,26 @@ int noanal_testfn(int y) NO_THREAD_SAFETY_ANALYSIS;
int noanal_testfn(int y) {
int x NO_THREAD_SAFETY_ANALYSIS = y; // \
- // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+ // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
return x;
};
int noanal_test_var NO_THREAD_SAFETY_ANALYSIS; // \
- // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+ // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
class NoanalFoo {
private:
int test_field NO_THREAD_SAFETY_ANALYSIS; // \
- // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+ // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
void test_method() NO_THREAD_SAFETY_ANALYSIS;
};
class NO_THREAD_SAFETY_ANALYSIS NoanalTestClass { // \
- // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+ // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
};
void noanal_fun_params(int lvar NO_THREAD_SAFETY_ANALYSIS); // \
- // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+ // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
//-----------------------------------------//
@@ -577,26 +577,26 @@ int elf_testfn(int y) EXCLUSIVE_LOCK_FUNCTION();
int elf_testfn(int y) {
int x EXCLUSIVE_LOCK_FUNCTION() = y; // \
- // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
return x;
};
int elf_test_var EXCLUSIVE_LOCK_FUNCTION(); // \
- // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
class ElfFoo {
private:
int test_field EXCLUSIVE_LOCK_FUNCTION(); // \
- // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
void test_method() EXCLUSIVE_LOCK_FUNCTION();
};
class EXCLUSIVE_LOCK_FUNCTION() ElfTestClass { // \
- // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
};
void elf_fun_params(int lvar EXCLUSIVE_LOCK_FUNCTION()); // \
- // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
// Check argument parsing.
@@ -649,25 +649,25 @@ int slf_testfn(int y) SHARED_LOCK_FUNCTION();
int slf_testfn(int y) {
int x SHARED_LOCK_FUNCTION() = y; // \
- // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_lock_function' attribute only applies to functions}}
return x;
};
int slf_test_var SHARED_LOCK_FUNCTION(); // \
- // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_lock_function' attribute only applies to functions}}
void slf_fun_params(int lvar SHARED_LOCK_FUNCTION()); // \
- // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_lock_function' attribute only applies to functions}}
class SlfFoo {
private:
int test_field SHARED_LOCK_FUNCTION(); // \
- // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_lock_function' attribute only applies to functions}}
void test_method() SHARED_LOCK_FUNCTION();
};
class SHARED_LOCK_FUNCTION() SlfTestClass { // \
- // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_lock_function' attribute only applies to functions}}
};
// Check argument parsing.
@@ -725,26 +725,26 @@ int etf_testfn(int y) EXCLUSIVE_TRYLOCK_FUNCTION(1);
int etf_testfn(int y) {
int x EXCLUSIVE_TRYLOCK_FUNCTION(1) = y; // \
- // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_trylock_function' attribute only applies to functions}}
return x;
};
int etf_test_var EXCLUSIVE_TRYLOCK_FUNCTION(1); // \
- // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_trylock_function' attribute only applies to functions}}
class EtfFoo {
private:
int test_field EXCLUSIVE_TRYLOCK_FUNCTION(1); // \
- // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_trylock_function' attribute only applies to functions}}
void test_method() EXCLUSIVE_TRYLOCK_FUNCTION(1);
};
class EXCLUSIVE_TRYLOCK_FUNCTION(1) EtfTestClass { // \
- // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_trylock_function' attribute only applies to functions}}
};
void etf_fun_params(int lvar EXCLUSIVE_TRYLOCK_FUNCTION(1)); // \
- // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_trylock_function' attribute only applies to functions}}
// Check argument parsing.
@@ -798,26 +798,26 @@ int stf_testfn(int y) SHARED_TRYLOCK_FUNCTION(1);
int stf_testfn(int y) {
int x SHARED_TRYLOCK_FUNCTION(1) = y; // \
- // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_trylock_function' attribute only applies to functions}}
return x;
};
int stf_test_var SHARED_TRYLOCK_FUNCTION(1); // \
- // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_trylock_function' attribute only applies to functions}}
void stf_fun_params(int lvar SHARED_TRYLOCK_FUNCTION(1)); // \
- // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_trylock_function' attribute only applies to functions}}
class StfFoo {
private:
int test_field SHARED_TRYLOCK_FUNCTION(1); // \
- // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_trylock_function' attribute only applies to functions}}
void test_method() SHARED_TRYLOCK_FUNCTION(1);
};
class SHARED_TRYLOCK_FUNCTION(1) StfTestClass { // \
- // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_trylock_function' attribute only applies to functions}}
};
// Check argument parsing.
@@ -868,26 +868,26 @@ int uf_testfn(int y) UNLOCK_FUNCTION();
int uf_testfn(int y) {
int x UNLOCK_FUNCTION() = y; // \
- // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'unlock_function' attribute only applies to functions}}
return x;
};
int uf_test_var UNLOCK_FUNCTION(); // \
- // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'unlock_function' attribute only applies to functions}}
class UfFoo {
private:
int test_field UNLOCK_FUNCTION(); // \
- // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'unlock_function' attribute only applies to functions}}
void test_method() UNLOCK_FUNCTION();
};
class NO_THREAD_SAFETY_ANALYSIS UfTestClass { // \
- // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
+ // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
};
void uf_fun_params(int lvar UNLOCK_FUNCTION()); // \
- // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
+ // expected-warning {{'unlock_function' attribute only applies to functions}}
// Check argument parsing.
@@ -944,25 +944,25 @@ int lr_testfn(int y) LOCK_RETURNED(mu1);
int lr_testfn(int y) {
int x LOCK_RETURNED(mu1) = y; // \
- // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
+ // expected-warning {{'lock_returned' attribute only applies to functions}}
return x;
};
int lr_test_var LOCK_RETURNED(mu1); // \
- // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
+ // expected-warning {{'lock_returned' attribute only applies to functions}}
void lr_fun_params(int lvar LOCK_RETURNED(mu1)); // \
- // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
+ // expected-warning {{'lock_returned' attribute only applies to functions}}
class LrFoo {
private:
int test_field LOCK_RETURNED(mu1); // \
- // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
+ // expected-warning {{'lock_returned' attribute only applies to functions}}
void test_method() LOCK_RETURNED(mu1);
};
class LOCK_RETURNED(mu1) LrTestClass { // \
- // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
+ // expected-warning {{'lock_returned' attribute only applies to functions}}
};
// Check argument parsing.
@@ -1011,25 +1011,25 @@ int le_testfn(int y) LOCKS_EXCLUDED(mu1);
int le_testfn(int y) {
int x LOCKS_EXCLUDED(mu1) = y; // \
- // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
+ // expected-warning {{'locks_excluded' attribute only applies to functions}}
return x;
};
int le_test_var LOCKS_EXCLUDED(mu1); // \
- // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
+ // expected-warning {{'locks_excluded' attribute only applies to functions}}
void le_fun_params(int lvar LOCKS_EXCLUDED(mu1)); // \
- // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
+ // expected-warning {{'locks_excluded' attribute only applies to functions}}
class LeFoo {
private:
int test_field LOCKS_EXCLUDED(mu1); // \
- // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
+ // expected-warning {{'locks_excluded' attribute only applies to functions}}
void test_method() LOCKS_EXCLUDED(mu1);
};
class LOCKS_EXCLUDED(mu1) LeTestClass { // \
- // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
+ // expected-warning {{'locks_excluded' attribute only applies to functions}}
};
// Check argument parsing.
@@ -1078,25 +1078,25 @@ int elr_testfn(int y) EXCLUSIVE_LOCKS_REQUIRED(mu1);
int elr_testfn(int y) {
int x EXCLUSIVE_LOCKS_REQUIRED(mu1) = y; // \
- // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
return x;
};
int elr_test_var EXCLUSIVE_LOCKS_REQUIRED(mu1); // \
- // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
void elr_fun_params(int lvar EXCLUSIVE_LOCKS_REQUIRED(mu1)); // \
- // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
class ElrFoo {
private:
int test_field EXCLUSIVE_LOCKS_REQUIRED(mu1); // \
- // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
void test_method() EXCLUSIVE_LOCKS_REQUIRED(mu1);
};
class EXCLUSIVE_LOCKS_REQUIRED(mu1) ElrTestClass { // \
- // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
+ // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
};
// Check argument parsing.
@@ -1146,25 +1146,25 @@ int slr_testfn(int y) SHARED_LOCKS_REQUIRED(mu1);
int slr_testfn(int y) {
int x SHARED_LOCKS_REQUIRED(mu1) = y; // \
- // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_locks_required' attribute only applies to functions}}
return x;
};
int slr_test_var SHARED_LOCKS_REQUIRED(mu1); // \
- // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_locks_required' attribute only applies to functions}}
void slr_fun_params(int lvar SHARED_LOCKS_REQUIRED(mu1)); // \
- // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_locks_required' attribute only applies to functions}}
class SlrFoo {
private:
int test_field SHARED_LOCKS_REQUIRED(mu1); // \
- // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_locks_required' attribute only applies to functions}}
void test_method() SHARED_LOCKS_REQUIRED(mu1);
};
class SHARED_LOCKS_REQUIRED(mu1) SlrTestClass { // \
- // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
+ // expected-warning {{'shared_locks_required' attribute only applies to functions}}
};
// Check argument parsing.
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 6aca97ac743..f4c9237a50c 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -2047,10 +2047,9 @@ static std::string CalculateDiagnostic(const Record &S) {
ObjCInterface = 1U << 9,
Block = 1U << 10,
Namespace = 1U << 11,
- FuncTemplate = 1U << 12,
- Field = 1U << 13,
- CXXMethod = 1U << 14,
- ObjCProtocol = 1U << 15
+ Field = 1U << 12,
+ CXXMethod = 1U << 13,
+ ObjCProtocol = 1U << 14
};
uint32_t SubMask = 0;
@@ -2082,7 +2081,6 @@ static std::string CalculateDiagnostic(const Record &S) {
.Case("Block", Block)
.Case("CXXRecord", Class)
.Case("Namespace", Namespace)
- .Case("FunctionTemplate", FuncTemplate)
.Case("Field", Field)
.Case("CXXMethod", CXXMethod)
.Default(0);
@@ -2121,7 +2119,6 @@ static std::string CalculateDiagnostic(const Record &S) {
case Func | ObjCMethod | Class: return "ExpectedFunctionMethodOrClass";
case Func | Param:
case Func | ObjCMethod | Param: return "ExpectedFunctionMethodOrParameter";
- case Func | FuncTemplate:
case Func | ObjCMethod: return "ExpectedFunctionOrMethod";
case Func | Var: return "ExpectedVariableOrFunction";
OpenPOWER on IntegriCloud