diff options
Diffstat (limited to 'test/FixIt/fixit.cpp')
-rw-r--r-- | test/FixIt/fixit.cpp | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp index f264938..585c216 100644 --- a/test/FixIt/fixit.cpp +++ b/test/FixIt/fixit.cpp @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -pedantic -Wall -Wno-comment -verify -fcxx-exceptions -x c++ %s -// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ %s 2>&1 | FileCheck %s +// RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -x c++ -std=c++11 %s 2>&1 | FileCheck %s // RUN: cp %s %t // RUN: not %clang_cc1 -pedantic -Wall -Wno-comment -fcxx-exceptions -fixit -x c++ %t // RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -Wno-comment -fcxx-exceptions -x c++ %t @@ -308,6 +308,13 @@ namespace dtor_fixit { ~bar() { } // expected-error {{expected the class name after '~' to name a destructor}} // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:6-[[@LINE-1]]:9}:"foo" }; + + class bar { + ~bar(); + }; + ~bar::bar() {} // expected-error {{'~' in destructor name should be after nested name specifier}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:4}:"" + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:9-[[@LINE-2]]:9}:"~" } namespace PR5066 { @@ -340,3 +347,43 @@ namespace PR15045 { return c->a; // expected-error {{member reference type 'PR15045::Cl0' is not a pointer; maybe you meant to use '.'?}} } } + +namespace curly_after_base_clause { +struct A { void f(); }; +struct B : A // expected-error{{expected '{' after base class list}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:13-[[@LINE-1]]:13}:" {" + int i; +}; +struct C : A // expected-error{{expected '{' after base class list}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:13-[[@LINE-1]]:13}:" {" + using A::f; +}; +struct D : A // expected-error{{expected '{' after base class list}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:13-[[@LINE-1]]:13}:" {" + protected: +}; +struct E : A // expected-error{{expected '{' after base class list}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:13-[[@LINE-1]]:13}:" {" + template<typename T> struct inner { }; +}; +struct F : A // expected-error{{expected '{' after base class list}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:13-[[@LINE-1]]:13}:" {" + F() { } +}; +#if __cplusplus >= 201103L +struct G : A // expected-error{{expected '{' after base class list}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:13-[[@LINE-1]]:13}:" {" + constexpr G(int) { } +}; +struct H : A // expected-error{{expected '{' after base class list}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:13-[[@LINE-1]]:13}:" {" + static_assert(true, ""); +}; +#endif +} + +struct conversion_operator { + conversion_operator::* const operator int(); // expected-error {{put the complete type after 'operator'}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:32}:"" + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:44-[[@LINE-2]]:44}:" conversion_operator::* const" +}; |