llvm-project/clang-tools-extra/unittests
Eric Liu ff51f011d1 [change-namespace] handle constructor initializer: Derived : Base::Base() {} and added conflict detections
Summary:
namespace nx { namespace ny { class Base { public: Base(i) {}} } }
namespace na {
namespace nb {
class X : public nx::ny {
public:
  X() : Base::Base(1) {}
};
}
}

When changing from na::nb to x::y, "Base::Base" will be changed to "nx::ny::Base" and
 "Base::" in "Base::Base" will be replaced with "nx::ny::Base" too, which causes
conflict. This conflict should've been detected when adding replacements but was hidden by `addOrMergeReplacement`. We now also detect conflict when adding replacements where conflict must not happen.

The namespace lookup is tricky here, we simply replace "Base::Base()" with "nx::ny::Base()" as a workaround, which compiles but not perfect.

Reviewers: hokein

Subscribers: bkramer, cfe-commits

Differential Revision: https://reviews.llvm.org/D26637

llvm-svn: 287118
2016-11-16 16:54:53 +00:00
..
change-namespace [change-namespace] handle constructor initializer: Derived : Base::Base() {} and added conflict detections 2016-11-16 16:54:53 +00:00
clang-apply-replacements [clang-apply-replacements] use Range::operator==() instead of self-defined operator. 2016-06-21 17:59:57 +00:00
clang-move [clang-move] Make the output code look more pretty. 2016-11-15 09:06:59 +00:00
clang-query Remove autoconf support 2016-01-26 21:31:36 +00:00
clang-tidy Fix signed/unsigned comparison warnings 2016-10-18 13:15:31 +00:00
include/common Remove clang-modernize. 2015-12-17 11:49:19 +00:00
include-fixer [include-fixer] Support processing multiple files in one run. 2016-08-09 08:26:19 +00:00
CMakeLists.txt [clang-move] A prototype tool for moving class definition to new file. 2016-09-21 13:18:19 +00:00