Skip to content

Commit 8a5b3e1

Browse files
committed
prevent default throw warning for reserved attribute names
1 parent 2bbaddd commit 8a5b3e1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

clang/include/clang/Basic/DiagnosticLexKinds.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ def warn_pp_macro_is_reserved_id : Warning<
408408
"macro name is a reserved identifier">, DefaultIgnore,
409409
InGroup<ReservedIdAsMacro>;
410410
def warn_pp_macro_is_reserved_attribute_id : Warning<
411-
"%0 is a reserved attribute identifier">, InGroup<ReservedAttributeIdentifier>;
411+
"%0 is a reserved attribute identifier">, DefaultIgnore,
412+
InGroup<ReservedAttributeIdentifier>;
412413
def warn_pp_objc_macro_redef_ignored : Warning<
413414
"ignoring redefinition of Objective-C qualifier macro">,
414415
InGroup<DiagGroup<"objc-macro-redefinition">>;

clang/test/Preprocessor/macro-reserved-attrs-cxx11.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -fsyntax-only -verify -pedantic %s -DTEST1
2-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -fsyntax-only -verify -pedantic %s -DTEST2
3-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -fsyntax-only -verify -pedantic %s -DTEST3
4-
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -fsyntax-only -verify -pedantic %s -DTEST4
1+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -Wreserved-attribute-identifier -fsyntax-only -verify %s -DTEST1
2+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -Wreserved-attribute-identifier -fsyntax-only -verify %s -DTEST2
3+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -Wreserved-attribute-identifier -fsyntax-only -verify %s -DTEST3
4+
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -Wreserved-attribute-identifier -fsyntax-only -verify %s -DTEST4
55

66
#ifdef TEST1
77

0 commit comments

Comments
 (0)