[PATCH] D98745: [clang] Add fixit for Wreorder-ctor
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 18 09:03:08 PDT 2021
njames93 updated this revision to Diff 331581.
njames93 added a comment.
Fix formatting issues
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98745/new/
https://reviews.llvm.org/D98745
Files:
clang/test/SemaCXX/constructor-initializer.cpp
clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp
Index: clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp
===================================================================
--- clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp
+++ clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp
@@ -5,14 +5,13 @@
struct BB1 {};
class complex : public BB, BB1 {
-public:
+public:
complex()
- : s2(1), // expected-warning {{some initializers aren't given in the correct order}} expected-note {{field 's2' will be initialized after field 's1'}}
- s1(1),
- s3(3), // expected-note {{field 's3' will be initialized after base 'BB1'}}
- BB1(), // expected-note {{base class 'BB1' will be initialized after base 'BB'}}
- BB()
- {}
+ : s2(1), // expected-warning {{some initializers aren't given in the correct order}} expected-note {{field 's2' will be initialized after field 's1'}}
+ s1(1),
+ s3(3), // expected-note {{field 's3' will be initialized after base 'BB1'}}
+ BB1(), // expected-note {{base class 'BB1' will be initialized after base 'BB'}}
+ BB() {}
int s1;
int s2;
int s3;
Index: clang/test/SemaCXX/constructor-initializer.cpp
===================================================================
--- clang/test/SemaCXX/constructor-initializer.cpp
+++ clang/test/SemaCXX/constructor-initializer.cpp
@@ -94,11 +94,11 @@
Current() : Derived(1), ::Derived(), // expected-warning {{some initializers aren't given in the correct order}} \
// expected-note {{field 'Derived' will be initialized after base '::Derived'}} \
// expected-note {{base class '::Derived' will be initialized after base 'Derived::V'}}
- ::Derived::Base(), // expected-error {{type '::Derived::Base' is not a direct or virtual base of 'Current'}}
- Derived::Base1(), // expected-error {{type 'Derived::Base1' is not a direct or virtual base of 'Current'}}
- Derived::V(),
- ::NonExisting(), // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
- INT::NonExisting() {} // expected-error {{'INT' (aka 'int') is not a class, namespace, or enumeration}} \
+ ::Derived::Base(), // expected-error {{type '::Derived::Base' is not a direct or virtual base of 'Current'}}
+ Derived::Base1(), // expected-error {{type 'Derived::Base1' is not a direct or virtual base of 'Current'}}
+ Derived::V(),
+ ::NonExisting(), // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
+ INT::NonExisting() {} // expected-error {{'INT' (aka 'int') is not a class, namespace, or enumeration}} \
// expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98745.331581.patch
Type: text/x-patch
Size: 3012 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210318/9b2a7108/attachment.bin>
More information about the cfe-commits
mailing list