diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 56d91b49b13fe55c918afbda19f6165b5fbff87a (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/Parser/cxx0x-decl.cpp | |
parent | 41e20f564abdb05101d6b2b29c59459a966c22cc (diff) |
Notes
Diffstat (limited to 'test/Parser/cxx0x-decl.cpp')
-rw-r--r-- | test/Parser/cxx0x-decl.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp index b9f5141a531e..a6fc49cb9e9d 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 @@ namespace Commas { } struct S {}; -enum E { e }; +enum E { e, }; auto f() -> struct S { return S(); @@ -16,3 +16,15 @@ auto f() -> struct S { 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}} +}; + +int *const const p = 0; // ok +const const int *q = 0; // expected-warning {{duplicate 'const' declaration specifier}} |