Add diagnostics for comma at end of enum and for extra semicolon at namespace
scope to -Wc++11-extensions. Move extra semicolon after member function
definition diagnostic out of -pedantic, since C++ allows a single semicolon
there. Keep it in -Wextra-semi, though, since it's still questionable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160618 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp
index b9f5141..9a220ca 100644
--- a/test/Parser/cxx0x-decl.cpp
+++ b/test/Parser/cxx0x-decl.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -fsyntax-only -std=c++0x %s
+// RUN: %clang_cc1 -verify -fsyntax-only -std=c++11 -pedantic %s
 
 // Make sure we know these are legitimate commas and not typos for ';'.
 namespace Commas {
@@ -8,7 +8,7 @@
 }
 
 struct S {};
-enum E { e };
+enum E { e, };
 
 auto f() -> struct S {
   return S();
@@ -16,3 +16,12 @@
 auto g() -> enum E {
   return E();
 }
+
+class ExtraSemiAfterMemFn {
+  // Due to a peculiarity in the C++11 grammar, a deleted or defaulted function
+  // is permitted to be followed by either one or two semicolons.
+  void f() = delete // expected-error {{expected ';' after delete}}
+  void g() = delete; // ok
+  void h() = delete;; // ok
+  void i() = delete;;; // expected-warning {{extra ';' after member function definition}}
+};