r195581 - Switching the common attribute over to using the generic diagnostic, and removing the now-unused diagnostic. Updates a test case.
Aaron Ballman
aaron at aaronballman.com
Sun Nov 24 13:48:06 PST 2013
Author: aaronballman
Date: Sun Nov 24 15:48:06 2013
New Revision: 195581
URL: http://llvm.org/viewvc/llvm-project?rev=195581&view=rev
Log:
Switching the common attribute over to using the generic diagnostic, and removing the now-unused diagnostic. Updates a test case.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/test/SemaCXX/attr-common.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=195581&r1=195580&r2=195581&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sun Nov 24 15:48:06 2013
@@ -1855,8 +1855,6 @@ def err_format_attribute_result_not : Er
def err_format_attribute_implicit_this_format_string : Error<
"format attribute cannot specify the implicit this argument as the format "
"string">;
-def err_common_not_supported_cplusplus : Error<
- "common attribute is not supported in C++">;
def err_init_method_bad_return_type : Error<
"init methods must return an object pointer type, not %0">;
def err_attribute_invalid_size : Error<
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=195581&r1=195580&r2=195581&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Sun Nov 24 15:48:06 2013
@@ -1854,7 +1854,8 @@ static void handleNoCommonAttr(Sema &S,
static void handleCommonAttr(Sema &S, Decl *D, const AttributeList &Attr) {
if (S.LangOpts.CPlusPlus) {
- S.Diag(Attr.getLoc(), diag::err_common_not_supported_cplusplus);
+ S.Diag(Attr.getLoc(), diag::err_attribute_not_supported_in_lang)
+ << Attr.getName() << AttributeLangSupport::Cpp;
return;
}
Modified: cfe/trunk/test/SemaCXX/attr-common.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-common.cpp?rev=195581&r1=195580&r2=195581&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-common.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-common.cpp Sun Nov 24 15:48:06 2013
@@ -1,3 +1,3 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-__attribute__((common)) int x; // expected-error {{common attribute is not supported in C++}}
+__attribute__((common)) int x; // expected-error {{'common' attribute is not supported in C++}}
More information about the cfe-commits
mailing list