blob: 9a220caa5ad5d6f932e38934a8dfbb3223501191 [file] [log] [blame]
Richard Smitheab9d6f2012-07-23 05:45:25 +00001// RUN: %clang_cc1 -verify -fsyntax-only -std=c++11 -pedantic %s
Richard Smith0706df42011-10-19 21:33:05 +00002
3// Make sure we know these are legitimate commas and not typos for ';'.
4namespace Commas {
5 int a,
6 b [[ ]],
7 c alignas(double);
8}
Richard Smith7796eb52012-03-12 08:56:40 +00009
10struct S {};
Richard Smitheab9d6f2012-07-23 05:45:25 +000011enum E { e, };
Richard Smith7796eb52012-03-12 08:56:40 +000012
13auto f() -> struct S {
14 return S();
15}
16auto g() -> enum E {
17 return E();
18}
Richard Smitheab9d6f2012-07-23 05:45:25 +000019
20class ExtraSemiAfterMemFn {
21 // Due to a peculiarity in the C++11 grammar, a deleted or defaulted function
22 // is permitted to be followed by either one or two semicolons.
23 void f() = delete // expected-error {{expected ';' after delete}}
24 void g() = delete; // ok
25 void h() = delete;; // ok
26 void i() = delete;;; // expected-warning {{extra ';' after member function definition}}
27};