diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2016-01-15 00:35:12 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2016-01-15 14:05:22 +0000 |
commit | 5be49c518745df87582877211e6c5cf5f0e4efd3 (patch) | |
tree | 6a38cb9297dd8ae13d59fa4ebcae046cf82e805a /src/libs/3rdparty/cplusplus/FullySpecifiedType.cpp | |
parent | 07dd7d5fe233a1c500332b4f3e8e6ec1e729f1d5 (diff) |
C++: Match const/volatile/signed/unsigned for FullySpecifiedType
Changing a function signature from const to non-const is not recognized as a
changed, and doesn't trigger the "Apply Function Signature Changes" quickfix.
For example:
void func(Foo &var);
void func(Foo &var) {} // Add const before Foo, quickfix is not triggered
Change-Id: I71ae41765d66df69204abd085fdfcfcb2d605f4c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/FullySpecifiedType.cpp')
-rw-r--r-- | src/libs/3rdparty/cplusplus/FullySpecifiedType.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libs/3rdparty/cplusplus/FullySpecifiedType.cpp b/src/libs/3rdparty/cplusplus/FullySpecifiedType.cpp index f78e4e9338..82f1e63eea 100644 --- a/src/libs/3rdparty/cplusplus/FullySpecifiedType.cpp +++ b/src/libs/3rdparty/cplusplus/FullySpecifiedType.cpp @@ -216,5 +216,16 @@ void FullySpecifiedType::setFlags(unsigned flags) bool FullySpecifiedType::match(const FullySpecifiedType &otherTy, Matcher *matcher) const { + static const unsigned flagsMask = [](){ + FullySpecifiedType ty; + ty.f._isConst = true; + ty.f._isVolatile = true; + ty.f._isSigned = true; + ty.f._isUnsigned = true; + return ty._flags; + }(); + + if ((_flags & flagsMask) != (otherTy._flags & flagsMask)) + return false; return type()->match(otherTy.type(), matcher); } |