- Add unit tests for renaming enum.
- Support unscoped enum constants in expressions.
Details
Diff Detail
- Build Status
Buildable 11242 Build 11242: arc lint + arc unit
Event Timeline
lib/Tooling/Refactoring/Rename/USRLocFinder.cpp | ||
---|---|---|
212 | Thanks for pointing it out (we missed such test case before). Yeah, this should be a FIXME, and added the case to the unittest. | |
228 | This is the behavior of Expr->getLocEnd() or Expr->getSourceRange().getEnd(), which returns the start location of the last token. |
lib/Tooling/Refactoring/Rename/USRLocFinder.cpp | ||
---|---|---|
212 | It would be nice if this could also be fixed in this patch; I think it might affect the current code structure. This doesn't seem to be a very hard case to fix after all? | |
228 | I'm a bit nervous about the implementation - it feels a bit too hacky... Would it be possible to get the range for the qualifier ns1::ns2:: from the DeclRefExpr? |
Use getQualifierLoc.
lib/Tooling/Refactoring/Rename/USRLocFinder.cpp | ||
---|---|---|
212 | To fix this case , we have to insert the prefix qualifier at the BeginLoc, which is not supported by the current code. | |
228 | Switched to use getQualifierLoc, we still need to exclude the last :: by moving 1 character backward. |
Why do we ignore this case? What if Color is moved to a different namespace? We would also need to qualify Green with a new namespace.