[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdevelop] languages/cpp/cppduchain: Initialize struct members in the constructor, otherwise you nee
From:       Alexander Dymo <adymo () kdevelop ! org>
Date:       2012-10-28 21:08:22
Message-ID: 20121028210822.5537AA6078 () git ! kde ! org
[Download RAW message or body]

Git commit 6ca2eb653242015dff7dc808b714c3e68f6b8fe6 by Alexander Dymo.
Committed on 28/10/2012 at 22:07.
Pushed by dymo into branch 'master'.

Initialize struct members in the constructor, otherwise you need C++11 compiler to \
compile this code

M  +11   -6    languages/cpp/cppduchain/templateresolver.h

http://commits.kde.org/kdevelop/6ca2eb653242015dff7dc808b714c3e68f6b8fe6

diff --git a/languages/cpp/cppduchain/templateresolver.h \
b/languages/cpp/cppduchain/templateresolver.h index 77a2370..518258b 100644
--- a/languages/cpp/cppduchain/templateresolver.h
+++ b/languages/cpp/cppduchain/templateresolver.h
@@ -52,24 +52,29 @@ class KDEVCPPDUCHAIN_EXPORT TemplateResolver {
 
     struct TemplateMatchType
     {
+      TemplateMatchType():
+        valid(true), constMatch(false), referenceMatch(false), arrayMatch(false),
+        templateArgsMatch(false), pointerMatchDepth(0)
+      {
+      }
       //Whether or not the match is at all valid
-      bool valid = true;
+      bool valid;
       //Given a const argument, is the parameter also const?
       //A non-const argument against a const parameter is not valid
       // !!!A "const type pointer" argument with a "const type pointer" parameter is \
                NOT valid unless the pointerMatchDepth is the same
       // !!!Otherwise a "const type pointer" argument will match the closest "type \
                pointer" depth
-      bool constMatch = false;
+      bool constMatch;
       //Given a reference/RValue argument, is the parameter also a reference/RValue?
       //A non-reference/RValue argument against a reference/RValue parameter is not \
                valid
-      bool referenceMatch = false;
+      bool referenceMatch;
       //Given a reference argument, is the parameter also a reference?
       //A non-reference argument against a reference parameter is not valid
-      bool arrayMatch = false;
+      bool arrayMatch;
       //Given a template declaration argument, do it and its arguments match the \
                parameter and its parameters?
-      bool templateArgsMatch = false;
+      bool templateArgsMatch;
       //How many of the argument's pointers are matched by the parameter?
       //An argument with less pointer depth than the parameter is not valid
-      uint pointerMatchDepth = 0;
+      uint pointerMatchDepth;
 
       uint toUint()
       {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic