[llvm] r280345 - [Support] Fix a warning introduced in r280339 due to the member

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 02:31:02 PDT 2016

Author: chandlerc
Date: Thu Sep  1 04:31:02 2016
New Revision: 280345

URL: http://llvm.org/viewvc/llvm-project?rev=280345&view=rev
[Support] Fix a warning introduced in r280339 due to the member
initializers not being in the same order as the members.

Specifically, 'preg' is the first member followed by 'error', so they
will be initialized in that order and should be written in the member
initializer list in that order.

For the constructor in question, there is no change in behavior.


Modified: llvm/trunk/lib/Support/Regex.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Regex.cpp?rev=280345&r1=280344&r2=280345&view=diff
--- llvm/trunk/lib/Support/Regex.cpp (original)
+++ llvm/trunk/lib/Support/Regex.cpp Thu Sep  1 04:31:02 2016
@@ -19,7 +19,7 @@
 #include <string>
 using namespace llvm;
-Regex::Regex() : error(REG_BADPAT), preg(nullptr) {}
+Regex::Regex() : preg(nullptr), error(REG_BADPAT) {}
 Regex::Regex(StringRef regex, unsigned Flags) {
   unsigned flags = 0;

More information about the llvm-commits mailing list