Commit dad374c
authored
CheckClass: renamed
In AIX, TRUE and FALSE are already defined in AIX system header files.
As a result, compiling cppcheck in AIX fails with the following errors:
```
/home/buildusr/cppcheck/lib/checkclass.h:231:38: error: expected identifier before numeric constant
231 | enum class Bool : std::uint8_t { TRUE, FALSE, BAILOUT };
| ^~~~
/home/buildusr/cppcheck/lib/checkclass.h:231:38: error: expected '}' before numeric constant
In file included from /home/buildusr/cppcheck/lib/astutils.cpp:37:
/home/buildusr/cppcheck/lib/checkclass.h:231:36: note: to match this '{'
231 | enum class Bool : std::uint8_t { TRUE, FALSE, BAILOUT };
| ^
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/10/include-fixed/wchar.h:50,
from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/10/include/c++/cwchar:44,
from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/10/include/c++/bits/postypes.h:40,
from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/10/include/c++/bits/char_traits.h:40,
from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/10/include/c++/string:40,
from /home/buildusr/cppcheck/lib/matchcompiler.h:23,
from /home/buildusr/cppcheck/build/lib/build/mc_astutils.cpp:1:
/home/buildusr/cppcheck/lib/checkclass.h:231:38: error: expected unqualified-id before numeric constant
231 | enum class Bool : std::uint8_t { TRUE, FALSE, BAILOUT };
| ^~~~
In file included from /home/buildusr/cppcheck/lib/astutils.cpp:37:
/home/buildusr/cppcheck/lib/checkclass.h:232:12: error: 'Bool' does not name a type; did you mean 'bool'?
232 | static Bool isInverted(const Token *tok, const Token *rhs);
| ^~~~
| bool
/home/buildusr/cppcheck/lib/checkclass.h:236:60: error: non-member function 'bool isMemberVar(const Scope*, const Token*)' cannot have cv-qualifier
236 | bool isMemberVar(const Scope *scope, const Token *tok) const;
| ^~~~~
/home/buildusr/cppcheck/lib/checkclass.h:240:97: error: non-member function 'bool checkConstFunc(const Scope*, const Function*, MemberAccess&)' cannot have cv-qualifier
240 | bool checkConstFunc(const Scope *scope, const Function *func, MemberAccess& memberAccessed) const;
| ^~~~~
/home/buildusr/cppcheck/lib/checkclass.h:313:137: error: non-member function 'void initializeVarList(const Function&, std::__cxx11::list<const Function*>&, const Scope*, std::vector<Usage>&)' cannot have cv-qualifier
313 | void initializeVarList(const Function &func, std::list<const Function *> &callstack, const Scope *scope, std::vector<Usage> &usage) const;
| ^~~~~
/home/buildusr/cppcheck/lib/checkclass.h:344:1: error: expected declaration before '}' token
344 | };
| ^
```
In this PR, TRUE and FALSE is being renamed to True and False to resolve
this issue. Please let me know your suggestions or concerns on these
changes.Bool enum values (#8187)1 parent cc24161 commit dad374c
2 files changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1872 | 1872 | | |
1873 | 1873 | | |
1874 | 1874 | | |
1875 | | - | |
| 1875 | + | |
1876 | 1876 | | |
1877 | 1877 | | |
1878 | 1878 | | |
1879 | | - | |
1880 | | - | |
| 1879 | + | |
| 1880 | + | |
1881 | 1881 | | |
1882 | 1882 | | |
1883 | 1883 | | |
1884 | 1884 | | |
1885 | 1885 | | |
1886 | 1886 | | |
1887 | 1887 | | |
1888 | | - | |
| 1888 | + | |
1889 | 1889 | | |
1890 | | - | |
| 1890 | + | |
1891 | 1891 | | |
1892 | | - | |
| 1892 | + | |
1893 | 1893 | | |
1894 | 1894 | | |
1895 | 1895 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
0 commit comments