From 8b265bd5eba1394273693e6705a43adac6b6aa2f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 23 Nov 2008 23:20:13 +0000 Subject: [PATCH] remove warn_previous_declaration git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59922 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticKinds.def | 2 -- lib/Sema/SemaDeclObjC.cpp | 11 ++++------- test/SemaObjC/alias-test-1.m | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def index 45b0535dec..f1024c36e6 100644 --- a/include/clang/Basic/DiagnosticKinds.def +++ b/include/clang/Basic/DiagnosticKinds.def @@ -504,8 +504,6 @@ DIAG(err_missing_class_definition, ERROR, "cannot find definition of 'Class'") DIAG(warn_previous_alias_decl, WARNING, "previously declared alias is ignored") -DIAG(warn_previous_declaration, WARNING, - "previous declaration is here") DIAG(err_conflicting_aliasing_type, ERROR, "conflicting types for alias %0") DIAG(err_statically_allocated_object, ERROR, diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 7a7b3767b8..0b4ebabb9a 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -143,14 +143,11 @@ Sema::DeclTy *Sema::ActOnCompatiblityAlias(SourceLocation AtLoc, // Look for previous declaration of alias name Decl *ADecl = LookupDecl(AliasName, Decl::IDNS_Ordinary, TUScope); if (ADecl) { - if (isa(ADecl)) { + if (isa(ADecl)) Diag(AliasLocation, diag::warn_previous_alias_decl); - Diag(ADecl->getLocation(), diag::warn_previous_declaration); - } - else { + else Diag(AliasLocation, diag::err_conflicting_aliasing_type) << AliasName; - Diag(ADecl->getLocation(), diag::note_previous_declaration); - } + Diag(ADecl->getLocation(), diag::note_previous_declaration); return 0; } // Check for class declaration @@ -159,7 +156,7 @@ Sema::DeclTy *Sema::ActOnCompatiblityAlias(SourceLocation AtLoc, if (CDecl == 0) { Diag(ClassLocation, diag::warn_undef_interface) << ClassName; if (CDeclU) - Diag(CDeclU->getLocation(), diag::warn_previous_declaration); + Diag(CDeclU->getLocation(), diag::note_previous_declaration); return 0; } diff --git a/test/SemaObjC/alias-test-1.m b/test/SemaObjC/alias-test-1.m index 377f62f5ba..6a33b98b36 100644 --- a/test/SemaObjC/alias-test-1.m +++ b/test/SemaObjC/alias-test-1.m @@ -5,7 +5,7 @@ @class class2; // expected-note {{previous declaration is here}} @class class3; -typedef int I; // expected-warning {{previous declaration is here}} +typedef int I; // expected-note {{previous declaration is here}} @compatibility_alias alias1 I; // expected-warning {{cannot find interface declaration for 'I'}} -- 2.40.0