From 056abd2059c65a3e908193aeae16fad98017437c Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 2 Dec 2012 13:20:44 +0000 Subject: Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2): http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974 --- test/Parser/MicrosoftExtensions.cpp | 56 ++++++++++-------- test/Parser/block-block-storageclass.c | 1 + test/Parser/block-pointer-decl.c | 1 + test/Parser/builtin_classify_type.c | 2 +- test/Parser/check-objc2-syntax-1.m | 1 + test/Parser/colon-colon-parentheses.cpp | 22 +++++++ test/Parser/compound_literal.c | 1 + test/Parser/cxx-ambig-decl-expr.cpp | 3 + test/Parser/cxx-attributes.cpp | 1 + test/Parser/cxx-casting.cpp | 12 ++-- test/Parser/cxx-class.cpp | 14 +++++ test/Parser/cxx-decl.cpp | 5 ++ test/Parser/cxx-extern-c-array.cpp | 1 + test/Parser/cxx-stmt.cpp | 8 +++ test/Parser/cxx-template-argument.cpp | 17 ++++++ test/Parser/cxx0x-attributes.cpp | 26 +++++++-- test/Parser/cxx0x-condition.cpp | 9 +-- test/Parser/cxx0x-decl.cpp | 14 +++-- test/Parser/cxx0x-lambda-expressions.cpp | 3 +- test/Parser/cxx0x-override-control-keywords.cpp | 1 + test/Parser/cxx11-brace-initializers.cpp | 16 +++++ test/Parser/cxx11-stmt-attributes.cpp | 77 ++++++++++++++++--------- test/Parser/cxx11-user-defined-literals.cpp | 3 +- test/Parser/empty-translation-unit.c | 2 +- test/Parser/encode.m | 1 + test/Parser/enhanced-proto-1.m | 1 + test/Parser/if-scope-c90.c | 1 + test/Parser/knr_parameter_attributes.c | 1 + test/Parser/ms-inline-asm.c | 8 +-- test/Parser/namelookup-bug-1.c | 1 + test/Parser/namelookup-bug-2.c | 1 + test/Parser/namespaces.cpp | 4 ++ test/Parser/objcxx11-attributes.mm | 18 ++++-- test/Parser/opencl-kernel.cl | 1 + test/Parser/parmvardecl_conversion.c | 1 + test/Parser/pragma-fp-contract.c | 12 ++++ test/Parser/pragma-options.cpp | 6 ++ test/Parser/recovery.cpp | 7 ++- test/Parser/recursion-limits.cpp | 1 + test/Parser/selector-1.m | 1 + test/Parser/statements.c | 15 +++++ test/Parser/top-level-semi-cxx0x.cpp | 1 + test/Parser/types.c | 1 + 43 files changed, 296 insertions(+), 82 deletions(-) create mode 100644 test/Parser/colon-colon-parentheses.cpp create mode 100644 test/Parser/cxx11-brace-initializers.cpp create mode 100644 test/Parser/pragma-fp-contract.c create mode 100644 test/Parser/pragma-options.cpp (limited to 'test/Parser') diff --git a/test/Parser/MicrosoftExtensions.cpp b/test/Parser/MicrosoftExtensions.cpp index 6219e29..fd38dca 100644 --- a/test/Parser/MicrosoftExtensions.cpp +++ b/test/Parser/MicrosoftExtensions.cpp @@ -174,13 +174,21 @@ void redundant_typename() { __interface MicrosoftInterface; __interface MicrosoftInterface { - virtual void foo1() = 0; + void foo1() = 0; virtual void foo2() = 0; }; +__interface MicrosoftDerivedInterface : public MicrosoftInterface { + void foo1(); + void foo2() override; + void foo3(); +}; + void interface_test() { MicrosoftInterface* a; a->foo1(); + MicrosoftDerivedInterface* b; + b->foo2(); } __int64 x7 = __int64(0); @@ -230,29 +238,29 @@ __if_not_exists(IF_EXISTS::Type_not) { int __if_exists_init_list() { - int array1[] = { - 0, - __if_exists(IF_EXISTS::Type) {2, } - 3 - }; - - int array2[] = { - 0, - __if_exists(IF_EXISTS::Type_not) { this wont compile } - 3 - }; - - int array3[] = { - 0, - __if_not_exists(IF_EXISTS::Type_not) {2, } - 3 - }; - - int array4[] = { - 0, - __if_not_exists(IF_EXISTS::Type) { this wont compile } - 3 - }; + int array1[] = { + 0, + __if_exists(IF_EXISTS::Type) {2, } + 3 + }; + + int array2[] = { + 0, + __if_exists(IF_EXISTS::Type_not) { this wont compile } + 3 + }; + + int array3[] = { + 0, + __if_not_exists(IF_EXISTS::Type_not) {2, } + 3 + }; + + int array4[] = { + 0, + __if_not_exists(IF_EXISTS::Type) { this wont compile } + 3 + }; } diff --git a/test/Parser/block-block-storageclass.c b/test/Parser/block-block-storageclass.c index 97ba113..53cd997 100644 --- a/test/Parser/block-block-storageclass.c +++ b/test/Parser/block-block-storageclass.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s +// expected-no-diagnostics int printf(const char *, ...); void _Block_byref_release(void*src){} diff --git a/test/Parser/block-pointer-decl.c b/test/Parser/block-pointer-decl.c index a8cc258..d88daf3 100644 --- a/test/Parser/block-pointer-decl.c +++ b/test/Parser/block-pointer-decl.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s +// expected-no-diagnostics int printf(char const *, ...); diff --git a/test/Parser/builtin_classify_type.c b/test/Parser/builtin_classify_type.c index a7c0855..ff483b2 100644 --- a/test/Parser/builtin_classify_type.c +++ b/test/Parser/builtin_classify_type.c @@ -10,7 +10,7 @@ int main() { static int ary[__builtin_classify_type(a)]; static int ary2[(__builtin_classify_type)(a)]; // expected-error{{variable length array declaration can not have 'static' storage duration}} - static int ary3[(*__builtin_classify_type)(a)]; // expected-error{{variable length array declaration can not have 'static' storage duration}} + static int ary3[(*__builtin_classify_type)(a)]; // expected-error{{builtin functions must be directly called}} int result; diff --git a/test/Parser/check-objc2-syntax-1.m b/test/Parser/check-objc2-syntax-1.m index 3cdf2b0..9aff963 100644 --- a/test/Parser/check-objc2-syntax-1.m +++ b/test/Parser/check-objc2-syntax-1.m @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics @interface Subclass + (int)magicNumber; diff --git a/test/Parser/colon-colon-parentheses.cpp b/test/Parser/colon-colon-parentheses.cpp new file mode 100644 index 0000000..55948fd --- /dev/null +++ b/test/Parser/colon-colon-parentheses.cpp @@ -0,0 +1,22 @@ +// RUN: %clang_cc1 %s -fsyntax-only -verify +// RUN: cp %s %t +// RUN: not %clang_cc1 -x c++ -fixit %t +// RUN: %clang_cc1 -x c++ %t + +struct S { static int a,b,c;}; +int S::(a); // expected-error{{unexpected parenthesis after '::'}} +int S::(b; // expected-error{{unexpected parenthesis after '::'}} +int S::c; +int S::(*d); // expected-error{{unexpected parenthesis after '::'}} +int S::(*e; // expected-error{{unexpected parenthesis after '::'}} +int S::*f; +int g = S::(a); // expected-error{{unexpected parenthesis after '::'}} +int h = S::(b; // expected-error{{unexpected parenthesis after '::'}} +int i = S::c; + +void foo() { + int a; + a = ::(g); // expected-error{{unexpected parenthesis after '::'}} + a = ::(h; // expected-error{{unexpected parenthesis after '::'}} + a = ::i; +} diff --git a/test/Parser/compound_literal.c b/test/Parser/compound_literal.c index 4f3609d..9a0e4a6 100644 --- a/test/Parser/compound_literal.c +++ b/test/Parser/compound_literal.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics int main() { char *s; s = (char []){"whatever"}; diff --git a/test/Parser/cxx-ambig-decl-expr.cpp b/test/Parser/cxx-ambig-decl-expr.cpp index b5ff728..feb185f 100644 --- a/test/Parser/cxx-ambig-decl-expr.cpp +++ b/test/Parser/cxx-ambig-decl-expr.cpp @@ -7,4 +7,7 @@ struct X { void f() { void (*ptr)(int, int) = &X::f; + + unknown *p = 0; // expected-error {{unknown type name 'unknown'}} + unknown * p + 0; // expected-error {{undeclared identifier 'unknown'}} } diff --git a/test/Parser/cxx-attributes.cpp b/test/Parser/cxx-attributes.cpp index 8603b30..5ea0ce2 100644 --- a/test/Parser/cxx-attributes.cpp +++ b/test/Parser/cxx-attributes.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics class c { virtual void f1(const char* a, ...) diff --git a/test/Parser/cxx-casting.cpp b/test/Parser/cxx-casting.cpp index 42ad12e..01980d3 100644 --- a/test/Parser/cxx-casting.cpp +++ b/test/Parser/cxx-casting.cpp @@ -58,9 +58,9 @@ void test2(char x, struct B * b) { expected-error {{expected ']'}} #define LC <: #define C : - test1::A LC:B> c; // expected-error {{cannot refer to class template 'A' without a template argument list}} expected-error 2{{}} expected-note{{}} + test1::A LC:B> c; // expected-error {{class template test1::A requires template arguments}} expected-error 2{{}} (void)static_cast LC:c>(&x); // expected-error {{expected '<' after 'static_cast'}} expected-error 2{{}} expected-note{{}} - test1::A<:C B> d; // expected-error {{cannot refer to class template 'A' without a template argument list}} expected-error 2{{}} expected-note{{}} + test1::A<:C B> d; // expected-error {{class template test1::A requires template arguments}} expected-error 2{{}} (void)static_cast<:C c>(&x); // expected-error {{expected '<' after 'static_cast'}} expected-error 2{{}} expected-note{{}} #define LCC <:: @@ -85,8 +85,10 @@ void test3() { E< ::F>(); // Make sure that parser doesn't expand '[:' to '< ::' - ::D[:F> A5; // expected-error {{cannot refer to class template 'D' without a template argument list}} \ + ::D[:F> A5; // expected-error {{class template ::D requires template arguments}} \ // expected-error {{expected expression}} \ - // expected-error {{expected ']'}} \ - // expected-note {{to match this '['}} + // expected-error {{expected unqualified-id}} } + +// PR13619. Must be at end of file. +int n = reinterpret_cast // expected-error {{expected '<'}} expected-error {{expected ';'}} diff --git a/test/Parser/cxx-class.cpp b/test/Parser/cxx-class.cpp index feccba8..8ed5882 100644 --- a/test/Parser/cxx-class.cpp +++ b/test/Parser/cxx-class.cpp @@ -88,6 +88,20 @@ namespace ctor_error { // expected-error{{unknown type name 'UnknownType'}} } +// PR13775: Don't assert here. +namespace PR13775 { + class bar + { + public: + void foo (); + void baz (); + }; + void bar::foo () + { + baz x(); // expected-error 3{{}} + } +} + // PR11109 must appear at the end of the source file class pr11109r3 { // expected-note{{to match this '{'}} public // expected-error{{expected ':'}} expected-error{{expected '}'}} expected-error{{expected ';' after class}} diff --git a/test/Parser/cxx-decl.cpp b/test/Parser/cxx-decl.cpp index 951cd3d..290b947 100644 --- a/test/Parser/cxx-decl.cpp +++ b/test/Parser/cxx-decl.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -verify -fsyntax-only -triple i386-linux -pedantic %s +const char const *x10; // expected-warning {{duplicate 'const' declaration specifier}} + int x(*g); // expected-error {{use of undeclared identifier 'g'}} struct Type { @@ -119,6 +121,9 @@ void CodeCompleteConsumer::() { // expected-error {{xpected unqualified-id}} ; +// PR4111 +void f(sqrgl); // expected-error {{unknown type name 'sqrgl'}} + // PR8380 extern "" // expected-error {{unknown linkage language}} test6a { ;// expected-error {{C++ requires a type specifier for all declarations}} \ diff --git a/test/Parser/cxx-extern-c-array.cpp b/test/Parser/cxx-extern-c-array.cpp index 14912fd..11092ad 100644 --- a/test/Parser/cxx-extern-c-array.cpp +++ b/test/Parser/cxx-extern-c-array.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics extern "C" int myarray[]; int myarray[12] = {0}; diff --git a/test/Parser/cxx-stmt.cpp b/test/Parser/cxx-stmt.cpp index 7677ca8..c2fa0a4 100644 --- a/test/Parser/cxx-stmt.cpp +++ b/test/Parser/cxx-stmt.cpp @@ -58,3 +58,11 @@ void f5() { asm volatile ("":: :"memory"); asm volatile ("": ::"memory"); } + +int f6() { + int k, // expected-note {{change this ',' to a ';' to call 'f6'}} + f6(), // expected-error {{expected ';'}} expected-warning {{interpreted as a function declaration}} expected-note {{replace paren}} + int n = 0, // expected-error {{expected ';'}} + return f5(), // ok + int(n); +} diff --git a/test/Parser/cxx-template-argument.cpp b/test/Parser/cxx-template-argument.cpp index 5479961..afe318d 100644 --- a/test/Parser/cxx-template-argument.cpp +++ b/test/Parser/cxx-template-argument.cpp @@ -25,3 +25,20 @@ namespace greatergreater { (void)(&t>==p); // expected-error {{use '> >'}} expected-error {{use '> ='}} } } + +namespace PR5925 { + template + class foo { // expected-note {{here}} + }; + void bar(foo *X) { // expected-error {{requires template arguments}} + } +} + +namespace PR13210 { + template + class C {}; // expected-note {{here}} + + void f() { + new C(); // expected-error {{requires template arguments}} + } +} diff --git a/test/Parser/cxx0x-attributes.cpp b/test/Parser/cxx0x-attributes.cpp index a0b8467..58e42bf 100644 --- a/test/Parser/cxx0x-attributes.cpp +++ b/test/Parser/cxx0x-attributes.cpp @@ -44,10 +44,15 @@ int & [[]] ref_attr = after_attr; int && [[]] rref_attr = 0; int array_attr [1] [[]]; alignas(8) int aligned_attr; -[[test::valid(for 42 [very] **** '+' symbols went on a trip and had a "good"_time; the end.)]] - int garbage_attr; -[[,,,static, class, namespace,, inline, constexpr, mutable,, bi\ -tand, bitor::compl(!.*_ Cx.!U^*R),,,]] int more_garbage_attr; +[[test::valid(for 42 [very] **** '+' symbols went on a trip and had a "good"_time; the end.)]] int garbage_attr; // expected-warning {{unknown attribute 'valid' ignored}} +[[,,,static, class, namespace,, inline, constexpr, mutable,, bitand, bitor::compl(!.*_ Cx.!U^*R),,,]] int more_garbage_attr; // expected-warning {{unknown attribute 'static' ignored}} \ + // expected-warning {{unknown attribute 'class' ignored}} \ + // expected-warning {{unknown attribute 'namespace' ignored}} \ + // expected-warning {{unknown attribute 'inline' ignored}} \ + // expected-warning {{unknown attribute 'constexpr' ignored}} \ + // expected-warning {{unknown attribute 'mutable' ignored}} \ + // expected-warning {{unknown attribute 'bitand' ignored}} \ + // expected-warning {{unknown attribute 'compl' ignored}} [[u8"invalid!"]] int invalid_string_attr; // expected-error {{expected ']'}} void fn_attr () [[]]; void noexcept_fn_attr () noexcept [[]]; @@ -212,3 +217,16 @@ enum class __attribute__((visibility("hidden"))) SecretKeepers { one, /* rest are deprecated */ two, three }; enum class [[]] EvenMoreSecrets {}; + +namespace arguments { + // FIXME: remove the sema warnings after migrating existing gnu attributes to c++11 syntax. + void f(const char*, ...) [[gnu::format(printf, 1, 2)]]; // expected-warning {{unknown attribute 'format' ignored}} + void g() [[unknown::foo(currently arguments of attributes from unknown namespace other than 'gnu' namespace are ignored... blah...)]]; // expected-warning {{unknown attribute 'foo' ignored}} +} + +// forbid attributes on decl specifiers +unsigned [[gnu::used]] static int [[gnu::unused]] v1; // expected-warning {{attribute 'unused' ignored, because it is not attached to a declaration}} \ + expected-error {{an attribute list cannot appear here}} +typedef [[gnu::used]] unsigned long [[gnu::unused]] v2; // expected-warning {{attribute 'unused' ignored, because it is not attached to a declaration}} \ + expected-error {{an attribute list cannot appear here}} +int [[carries_dependency]] foo(int [[carries_dependency]] x); // expected-warning 2{{attribute 'carries_dependency' ignored, because it is not attached to a declaration}} diff --git a/test/Parser/cxx0x-condition.cpp b/test/Parser/cxx0x-condition.cpp index e45cd86..8b64bcf 100644 --- a/test/Parser/cxx0x-condition.cpp +++ b/test/Parser/cxx0x-condition.cpp @@ -27,10 +27,11 @@ void f() { if (S b(n) = 0) {} // expected-error {{a function type is not allowed here}} if (S b(n) == 0) {} // expected-error {{a function type is not allowed here}} expected-error {{did you mean '='?}} - if (S{a}) {} // ok - if (S a{a}) {} // ok - if (S a = {a}) {} // ok - if (S a == {a}) {} // expected-error {{did you mean '='?}} + S s(a); + if (S{s}) {} // ok + if (S a{s}) {} // ok + if (S a = {s}) {} // ok + if (S a == {s}) {} // expected-error {{did you mean '='?}} if (S(b){a}) {} // ok if (S(b) = {a}) {} // ok diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp index a6fc49c..3af73f9 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++11 -pedantic %s +// RUN: %clang_cc1 -verify -fsyntax-only -std=c++11 -pedantic-errors %s // Make sure we know these are legitimate commas and not typos for ';'. namespace Commas { @@ -23,8 +23,14 @@ class ExtraSemiAfterMemFn { 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}} + void i() = delete;;; // expected-error {{extra ';' after member function definition}} }; -int *const const p = 0; // ok -const const int *q = 0; // expected-warning {{duplicate 'const' declaration specifier}} +int *const const p = 0; // expected-error {{duplicate 'const' declaration specifier}} +const const int *q = 0; // expected-error {{duplicate 'const' declaration specifier}} + +struct MultiCV { + void f() const const; // expected-error {{duplicate 'const' declaration specifier}} +}; + +static_assert(something, ""); // expected-error {{undeclared identifier}} diff --git a/test/Parser/cxx0x-lambda-expressions.cpp b/test/Parser/cxx0x-lambda-expressions.cpp index 7e9d475..642c69a 100644 --- a/test/Parser/cxx0x-lambda-expressions.cpp +++ b/test/Parser/cxx0x-lambda-expressions.cpp @@ -26,6 +26,7 @@ class C { [] -> int { return 0; }; // expected-error{{lambda requires '()' before return type}} [] mutable -> int { return 0; }; // expected-error{{lambda requires '()' before 'mutable'}} + [](int) -> {}; // PR13652 expected-error {{expected a type}} return 1; } @@ -33,7 +34,7 @@ class C { typedef int T; const int b = 0; const int c = 1; - int a1[1] = {[b] (T()) {}}; // expected-error{{no viable conversion from 'C:: void f(Ts ...x) { - [[test::foo(bar, baz)...]]; - [[used(x)...]]; + [[test::foo(bar, baz)...]]; // expected-error {{attribute 'foo' cannot be used as an attribute pack}} \ + // expected-warning {{unknown attribute 'foo' ignored}} + + [[used(x)...]]; // expected-error {{attribute 'used' cannot be used as an attribute pack}} \ + // expected-warning {{unknown attribute 'used' ignored}} + [[x...] { return [ X alloc ]; }() init]; } diff --git a/test/Parser/opencl-kernel.cl b/test/Parser/opencl-kernel.cl index 3abb62b..01c7ed6 100644 --- a/test/Parser/opencl-kernel.cl +++ b/test/Parser/opencl-kernel.cl @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only +// expected-no-diagnostics __kernel void test() { diff --git a/test/Parser/parmvardecl_conversion.c b/test/Parser/parmvardecl_conversion.c index 9fa8a68..f6afd12 100644 --- a/test/Parser/parmvardecl_conversion.c +++ b/test/Parser/parmvardecl_conversion.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// expected-no-diagnostics void f (int p[]) { p++; } diff --git a/test/Parser/pragma-fp-contract.c b/test/Parser/pragma-fp-contract.c new file mode 100644 index 0000000..568c0a0 --- /dev/null +++ b/test/Parser/pragma-fp-contract.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +void f1(void) { + int x = 0; +/* expected-error@+1 {{'#pragma fp_contract' should only appear at file scope or at the start of a compound expression}} */ +#pragma STDC FP_CONTRACT ON +} + +void f2(void) { + #pragma STDC FP_CONTRACT OFF + #pragma STDC FP_CONTRACT ON +} diff --git a/test/Parser/pragma-options.cpp b/test/Parser/pragma-options.cpp new file mode 100644 index 0000000..84cd38d --- /dev/null +++ b/test/Parser/pragma-options.cpp @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s +// expected-no-diagnostics + +class C { +#pragma options align=natural +}; diff --git a/test/Parser/recovery.cpp b/test/Parser/recovery.cpp index ff68758..732b9ae 100644 --- a/test/Parser/recovery.cpp +++ b/test/Parser/recovery.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -cc1 -verify -std=c++11 %s +// RUN: %clang_cc1 -verify -std=c++11 %s 8gi///===--- recovery.cpp ---===// // expected-error {{unqualified-id}} namespace Std { // expected-note {{here}} @@ -23,12 +23,15 @@ void g() { struct S { int a, b, c; S(); + int x // expected-error {{expected ';'}} + friend void f() }; 8S::S() : a{ 5 }, b{ 6 }, c{ 2 } { // expected-error {{unqualified-id}} return; } int k; -int l = k; +int l = k // expected-error {{expected ';'}} +constexpr int foo(); 5int m = { l }, n = m; // expected-error {{unqualified-id}} diff --git a/test/Parser/recursion-limits.cpp b/test/Parser/recursion-limits.cpp index ea25dea..bb7354f 100644 --- a/test/Parser/recursion-limits.cpp +++ b/test/Parser/recursion-limits.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only %s -verify +// expected-no-diagnostics class outer { class inner1 { inner1(); }; class inner2 { inner2(); }; diff --git a/test/Parser/selector-1.m b/test/Parser/selector-1.m index 5ba2da9..3e2a86d 100644 --- a/test/Parser/selector-1.m +++ b/test/Parser/selector-1.m @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify %s +// expected-no-diagnostics // rdar://8366474 int main() { diff --git a/test/Parser/statements.c b/test/Parser/statements.c index 3a123d6..8215f4c 100644 --- a/test/Parser/statements.c +++ b/test/Parser/statements.c @@ -62,3 +62,18 @@ void test8() { // Should not skip '}' and produce a "expected '}'" error. undecl // expected-error {{use of undeclared identifier 'undecl'}} } + +int test9() { + int T[] = {1, 2, }; + + int X; + X = 0, // expected-error {{expected ';' after expression}} + { + } + + X = 0, // expected-error {{expected ';' after expression}} + if (0) + ; + + return 4, // expected-error {{expected ';' after return statement}} +} diff --git a/test/Parser/top-level-semi-cxx0x.cpp b/test/Parser/top-level-semi-cxx0x.cpp index be342a2..472686e 100644 --- a/test/Parser/top-level-semi-cxx0x.cpp +++ b/test/Parser/top-level-semi-cxx0x.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++11 -verify %s +// expected-no-diagnostics void foo(); diff --git a/test/Parser/types.c b/test/Parser/types.c index 53b9dd5..db8c083 100644 --- a/test/Parser/types.c +++ b/test/Parser/types.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -fsyntax-only -verify +// expected-no-diagnostics // Test the X can be overloaded inside the struct. typedef int X; -- cgit v1.1