Switching the common attribute over to using the generic diagnostic, and removing the now-unused diagnostic. Updates a test case.

llvm-svn: 195581
This commit is contained in:
Aaron Ballman 2013-11-24 21:48:06 +00:00
parent df8fe4c91c
commit 3db89662c3
3 changed files with 3 additions and 4 deletions

View File

@ -1855,8 +1855,6 @@ def err_format_attribute_result_not : Error<"function does not return %0">;
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<

View File

@ -1854,7 +1854,8 @@ static void handleNoCommonAttr(Sema &S, Decl *D, const AttributeList &Attr) {
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;
}

View File

@ -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++}}