From fcff57751247d534159e0b51177cad5cc3e18ae7 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 3 Jun 2009 12:22:01 +0000 Subject: [PATCH] Minor cleanup for implicit int warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72770 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 7 ++----- lib/Sema/SemaType.cpp | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 4095600564..41e73c1788 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1789,12 +1789,9 @@ def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">; def warn_receiver_forward_class : Warning< "receiver %0 is a forward class and corresponding @interface may not exist">; def note_method_sent_forward_class : Note<"method %0 is used for the forward class">; -def warn_missing_declspec : ExtWarn< +def ext_missing_declspec : ExtWarn< "declaration specifier missing, defaulting to 'int'">; -def warn_missing_type_specifier : Warning< - "type specifier missing, defaults to 'int'">, - InGroup; -def warn_missing_type_specifier_c99 : ExtWarn< +def ext_missing_type_specifier : ExtWarn< "type specifier missing, defaults to 'int'">, InGroup; def err_decimal_unsupported : Error< diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 81ac21123e..cd19d97c5b 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -107,7 +107,7 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS, if (DS.isEmpty()) { if (DeclLoc.isInvalid()) DeclLoc = DS.getSourceRange().getBegin(); - Diag(DeclLoc, diag::warn_missing_declspec) + Diag(DeclLoc, diag::ext_missing_declspec) << DS.getSourceRange() << CodeModificationHint::CreateInsertion(DS.getSourceRange().getBegin(), "int"); @@ -125,7 +125,7 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS, Diag(DeclLoc, diag::err_missing_type_specifier) << DS.getSourceRange(); else - Diag(DeclLoc, diag::warn_missing_type_specifier) + Diag(DeclLoc, diag::ext_missing_type_specifier) << DS.getSourceRange(); // FIXME: If we could guarantee that the result would be well-formed, it -- 2.50.1