Index: test/Misc/warning-flags.c
===================================================================
--- test/Misc/warning-flags.c	(revision 155493)
+++ test/Misc/warning-flags.c	(working copy)
@@ -17,7 +17,7 @@
 
 The list of warnings below should NEVER grow.  It should gradually shrink to 0.
 
-CHECK: Warnings without flags (253):
+CHECK: Warnings without flags (250):
 CHECK-NEXT:   ext_anonymous_struct_union_qualified
 CHECK-NEXT:   ext_binary_literal
 CHECK-NEXT:   ext_cast_fn_obj
@@ -33,8 +33,6 @@
 CHECK-NEXT:   ext_expected_semi_decl_list
 CHECK-NEXT:   ext_explicit_instantiation_without_qualified_id
 CHECK-NEXT:   ext_explicit_specialization_storage_class
-CHECK-NEXT:   ext_extra_ivar_semi
-CHECK-NEXT:   ext_extra_struct_semi
 CHECK-NEXT:   ext_forward_ref_enum
 CHECK-NEXT:   ext_freestanding_complex
 CHECK-NEXT:   ext_hexconstant_invalid
@@ -65,7 +63,6 @@
 CHECK-NEXT:   ext_subscript_non_lvalue
 CHECK-NEXT:   ext_template_arg_extra_parens
 CHECK-NEXT:   ext_thread_before
-CHECK-NEXT:   ext_top_level_semi
 CHECK-NEXT:   ext_typecheck_addrof_void
 CHECK-NEXT:   ext_typecheck_cast_nonscalar
 CHECK-NEXT:   ext_typecheck_cast_to_union
Index: test/Parser/cxx-extra-semi.cpp
===================================================================
--- test/Parser/cxx-extra-semi.cpp	(revision 0)
+++ test/Parser/cxx-extra-semi.cpp	(revision 0)
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -fsyntax-only -Wextra-semi -verify %s
+// RUN: cp %s %t
+// RUN: %clang_cc1 -x c++ -Wextra-semi -fixit %t
+// RUN: %clang_cc1 -x c++ -Wextra-semi -Werror %t
+
+class A {
+  void A1();
+  void A2() { }; // expected-warning{{extra ';' after function definition}}
+  ; // expected-warning{{extra ';' inside a class}}
+  void A3() { };  ;; // expected-warning{{extra ';' after function definition}}
+  ;;;;;;; // expected-warning{{extra ';' inside a class}}
+  ; // expected-warning{{extra ';' inside a class}}
+  ; ;;		 ;  ;;; // expected-warning{{extra ';' inside a class}}
+    ;  ; 	;	;  ;; // expected-warning{{extra ';' inside a class}}
+  void A4();
+};
+
+union B {
+  int a1;
+  int a2;; // expected-warning{{extra ';' inside a union}}
+};
+
+; // expected-warning{{extra ';' outside of a function}}
+; ;;// expected-warning{{extra ';' outside of a function}}
+
Index: test/Parser/cxx-class.cpp
===================================================================
--- test/Parser/cxx-class.cpp	(revision 155493)
+++ test/Parser/cxx-class.cpp	(working copy)
@@ -14,9 +14,9 @@
 public:
   void m() {
     int l = 2;
-  };
+  }; // expected-warning{{extra ';' after function definition}}
 
-  template<typename T> void mt(T) { };
+  template<typename T> void mt(T) { }
   ; // expected-warning{{extra ';' inside a class}}
 
   virtual int vf() const volatile = 0;
Index: include/clang/Basic/DiagnosticParseKinds.td
===================================================================
--- include/clang/Basic/DiagnosticParseKinds.td	(revision 155493)
+++ include/clang/Basic/DiagnosticParseKinds.td	(working copy)
@@ -21,15 +21,16 @@
 let CategoryName = "Parse Issue" in {
 
 def ext_empty_source_file : Extension<"ISO C forbids an empty source file">;
-def ext_top_level_semi : Extension<
-  "extra ';' outside of a function">;
 def warn_cxx98_compat_top_level_semi : Warning<
   "extra ';' outside of a function is incompatible with C++98">,
   InGroup<CXX98CompatPedantic>, DefaultIgnore;
-def ext_extra_struct_semi : Extension<
-  "extra ';' inside a %0">;
-def ext_extra_ivar_semi : Extension<
-  "extra ';' inside instance variable list">;
+def ext_extra_semi : Extension<
+  "extra ';' %select{"
+  "outside of a function|"
+  "inside a %1|"
+  "inside instance variable list|"
+  "after function definition}0">,
+  InGroup<DiagGroup<"extra-semi">>;
 
 def ext_duplicate_declspec : Extension<"duplicate '%0' declaration specifier">;
 def ext_plain_complex : ExtWarn<
Index: include/clang/Parse/Parser.h
===================================================================
--- include/clang/Parse/Parser.h	(revision 155493)
+++ include/clang/Parse/Parser.h	(working copy)
@@ -643,6 +643,21 @@
   /// to the semicolon, consumes that extra token.
   bool ExpectAndConsumeSemi(unsigned DiagID);
 
+  /// \brief The kind of extra semi diagnostic to emit. 
+  enum ExtraSemiKind {
+    OutsideFunction = 0,
+    InsideStruct = 1,
+    InstanceVariableList = 2,
+    AfterDefinition = 3
+  };
+
+  /// \brief Consume any extra semi-colons until the end of the line.
+  ///
+  /// If CanStartLine is true, then the first semi-colon can begin a line.
+  /// Otherwise, defer consuming semi-colon until a later time.
+  void ConsumeExtraSemi(ExtraSemiKind Kind, bool CanStartLine,
+                        const char* DiagMsg = "");
+
   //===--------------------------------------------------------------------===//
   // Scope manipulation
 
Index: lib/Parse/ParseDecl.cpp
===================================================================
--- lib/Parse/ParseDecl.cpp	(revision 155493)
+++ lib/Parse/ParseDecl.cpp	(working copy)
@@ -2630,10 +2630,8 @@
 
     // Check for extraneous top-level semicolon.
     if (Tok.is(tok::semi)) {
-      Diag(Tok, diag::ext_extra_struct_semi)
-        << DeclSpec::getSpecifierName((DeclSpec::TST)TagType)
-        << FixItHint::CreateRemoval(Tok.getLocation());
-      ConsumeToken();
+      ConsumeExtraSemi(InsideStruct, /*CanStartLine*/true,
+                       DeclSpec::getSpecifierName((DeclSpec::TST)TagType));
       continue;
     }
 
Index: lib/Parse/ParseObjc.cpp
===================================================================
--- lib/Parse/ParseObjc.cpp	(revision 155493)
+++ lib/Parse/ParseObjc.cpp	(working copy)
@@ -1258,9 +1258,7 @@
 
     // Check for extraneous top-level semicolon.
     if (Tok.is(tok::semi)) {
-      Diag(Tok, diag::ext_extra_ivar_semi)
-        << FixItHint::CreateRemoval(Tok.getLocation());
-      ConsumeToken();
+      ConsumeExtraSemi(InstanceVariableList, /*CanStartLine*/true);
       continue;
     }
 
Index: lib/Parse/ParseDeclCXX.cpp
===================================================================
--- lib/Parse/ParseDeclCXX.cpp	(revision 155493)
+++ lib/Parse/ParseDeclCXX.cpp	(working copy)
@@ -1933,9 +1933,8 @@
       LateParsedAttrs.clear();
 
       // Consume the ';' - it's optional unless we have a delete or default
-      if (Tok.is(tok::semi)) {
-        ConsumeToken();
-      }
+      if (Tok.is(tok::semi))
+        ConsumeExtraSemi(AfterDefinition, /*CanStartLine*/false);
 
       return;
     }
@@ -2284,10 +2283,8 @@
 
       // Check for extraneous top-level semicolon.
       if (Tok.is(tok::semi)) {
-        Diag(Tok, diag::ext_extra_struct_semi)
-          << DeclSpec::getSpecifierName((DeclSpec::TST)TagType)
-          << FixItHint::CreateRemoval(Tok.getLocation());
-        ConsumeToken();
+        ConsumeExtraSemi(InsideStruct, /*CanStartLine*/true,
+                         DeclSpec::getSpecifierName((DeclSpec::TST)TagType));
         continue;
       }
 
@@ -3059,10 +3056,8 @@
 
     // Check for extraneous top-level semicolon.
     if (Tok.is(tok::semi)) {
-      Diag(Tok, diag::ext_extra_struct_semi)
-        << DeclSpec::getSpecifierName((DeclSpec::TST)TagType)
-        << FixItHint::CreateRemoval(Tok.getLocation());
-      ConsumeToken();
+      ConsumeExtraSemi(InsideStruct, /*CanStartLine*/true,
+                       DeclSpec::getSpecifierName((DeclSpec::TST)TagType));
       continue;
     }
 
Index: lib/Parse/Parser.cpp
===================================================================
--- lib/Parse/Parser.cpp	(revision 155493)
+++ lib/Parse/Parser.cpp	(working copy)
@@ -202,6 +202,31 @@
   return ExpectAndConsume(tok::semi, DiagID);
 }
 
+void Parser::ConsumeExtraSemi(ExtraSemiKind Kind, bool CanStartLine,
+                              const char* DiagMsg) {
+  if (!Tok.is(tok::semi)) return;
+  if (Tok.isAtStartOfLine() && !CanStartLine) return;
+
+  SourceLocation StartLoc = Tok.getLocation();
+  SourceLocation EndLoc = Tok.getLocation();
+  ConsumeToken();
+
+  while ((Tok.is(tok::semi) && !Tok.isAtStartOfLine())) {
+    EndLoc = Tok.getLocation();
+    ConsumeToken();
+  }
+
+  if (Kind == OutsideFunction && getLangOpts().CPlusPlus0x) {
+    Diag(StartLoc, diag::warn_cxx98_compat_top_level_semi)
+        << FixItHint::CreateRemoval(SourceRange(StartLoc, EndLoc));
+    return;
+  }
+
+  Diag(StartLoc, diag::ext_extra_semi)
+      << Kind << DiagMsg << FixItHint::CreateRemoval(SourceRange(StartLoc,
+                                                                 EndLoc));
+}
+
 //===----------------------------------------------------------------------===//
 // Error recovery.
 //===----------------------------------------------------------------------===//
@@ -582,11 +607,7 @@
     HandlePragmaPack();
     return DeclGroupPtrTy();
   case tok::semi:
-    Diag(Tok, getLangOpts().CPlusPlus0x ?
-         diag::warn_cxx98_compat_top_level_semi : diag::ext_top_level_semi)
-      << FixItHint::CreateRemoval(Tok.getLocation());
-
-    ConsumeToken();
+    ConsumeExtraSemi(OutsideFunction, /*CanStartLine=*/true);
     // TODO: Invoke action for top-level semicolon.
     return DeclGroupPtrTy();
   case tok::r_brace:
