diff options
Diffstat (limited to 'test/FixIt')
-rw-r--r-- | test/FixIt/fixit-cxx0x.cpp | 19 | ||||
-rw-r--r-- | test/FixIt/fixit-eof-space.c | 9 | ||||
-rw-r--r-- | test/FixIt/fixit-objc-bridge-related.m | 10 | ||||
-rw-r--r-- | test/FixIt/fixit-recursive-block.c | 2 | ||||
-rw-r--r-- | test/FixIt/fixit.cpp | 10 |
5 files changed, 43 insertions, 7 deletions
diff --git a/test/FixIt/fixit-cxx0x.cpp b/test/FixIt/fixit-cxx0x.cpp index 49a05ff..5aebcb3 100644 --- a/test/FixIt/fixit-cxx0x.cpp +++ b/test/FixIt/fixit-cxx0x.cpp @@ -158,3 +158,22 @@ namespace MisplacedParameterPack { template <int... N...> // expected-error {{'...' must immediately precede declared identifier}} void redundantEllipsisInNonTypeTemplateParameter(); } + +namespace MisplacedDeclAndRefSpecAfterVirtSpec { + struct B { + virtual void f(); + virtual void f() volatile const; + }; + struct D : B { + virtual void f() override; + virtual void f() override final const volatile; // expected-error {{'const' qualifier may not appear after the virtual specifier 'final'}} expected-error {{'volatile' qualifier may not appear after the virtual specifier 'final'}} + }; + struct B2 { + virtual void f() &; + virtual void f() volatile const &&; + }; + struct D2 : B2 { + virtual void f() override &; // expected-error {{'&' qualifier may not appear after the virtual specifier 'override'}} + virtual void f() override final const volatile &&; // expected-error {{'const' qualifier may not appear after the virtual specifier 'final'}} expected-error {{'volatile' qualifier may not appear after the virtual specifier 'final'}} expected-error {{'&&' qualifier may not appear after the virtual specifier 'final'}} + }; +} diff --git a/test/FixIt/fixit-eof-space.c b/test/FixIt/fixit-eof-space.c new file mode 100644 index 0000000..dc9a45d --- /dev/null +++ b/test/FixIt/fixit-eof-space.c @@ -0,0 +1,9 @@ +// RUN: not %clang_cc1 %s -fsyntax-only -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s +// vim: set binary noeol: + +// This file intentionally ends without a \n on the last line. Make sure your +// editor doesn't add one. The trailing space is also intentional. + +// CHECK: :9:8: warning: duplicate 'extern' declaration specifier +// CHECK: fix-it:"{{.*}}":{9:8-9:15}:"" +extern extern
\ No newline at end of file diff --git a/test/FixIt/fixit-objc-bridge-related.m b/test/FixIt/fixit-objc-bridge-related.m index 36ccbca..65974a2 100644 --- a/test/FixIt/fixit-objc-bridge-related.m +++ b/test/FixIt/fixit-objc-bridge-related.m @@ -25,11 +25,11 @@ void test(UIButton *myButton) { // CHECK: {17:36-17:36}:"[" // CHECK: {17:54-17:54}:" CGColor]" -// CHECK :{18:13-18:13}:"[" +// CHECK: {18:13-18:13}:"[" // CHECK: {18:31-18:31}:" CGColor]" -// CHECK :{22:25-22:25}:"[" -// CHECK :{22:45-22:45}:" CGColor]" +// CHECK: {22:25-22:25}:"[" +// CHECK: {22:45-22:45}:" CGColor]" @interface ImplicitPropertyTest - (UIColor *)tintColor; @@ -39,5 +39,5 @@ void test1(ImplicitPropertyTest *myImplicitPropertyTest) { CGColorRef cgColor = (CGColorRef)[myImplicitPropertyTest tintColor]; } -// CHECK :{39:36-39:36}:"[" -// CHECK :{39:70-39:70}:" CGColor]" +// CHECK: {39:36-39:36}:"[" +// CHECK: {39:70-39:70}:" CGColor]" diff --git a/test/FixIt/fixit-recursive-block.c b/test/FixIt/fixit-recursive-block.c index b276b41..3793f82 100644 --- a/test/FixIt/fixit-recursive-block.c +++ b/test/FixIt/fixit-recursive-block.c @@ -5,7 +5,7 @@ int main() { void (^arc_fail)() = ^() { // expected-warning {{block pointer variable 'arc_fail' is uninitialized when captured by block}} \ - // expected-note {{maybe you meant to use __block 'arc_fail'}} + // expected-note {{did you mean to use __block 'arc_fail'}} arc_fail(); // BOOM }; } diff --git a/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp index 585c216..512713a 100644 --- a/test/FixIt/fixit.cpp +++ b/test/FixIt/fixit.cpp @@ -344,7 +344,7 @@ namespace PR15045 { int f() { Cl0 c; - return c->a; // expected-error {{member reference type 'PR15045::Cl0' is not a pointer; maybe you meant to use '.'?}} + return c->a; // expected-error {{member reference type 'PR15045::Cl0' is not a pointer; did you mean to use '.'?}} } } @@ -387,3 +387,11 @@ struct conversion_operator { // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:32}:"" // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:44-[[@LINE-2]]:44}:" conversion_operator::* const" }; + +struct const_zero_init { + int a; +}; +const const_zero_init czi; // expected-error {{default initialization of an object of const type 'const const_zero_init'}} +// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:26-[[@LINE-1]]:26}:"{}" +int use_czi = czi.a; + |