Review Request 124598: Extract variable refactoring
Maciej Poleski
d82ks8djf82msd83hf8sc02lqb5gh5 at gmail.com
Mon Aug 3 18:30:42 UTC 2015
> On Sie 3, 2015, 8:13 po południu, Kevin Funk wrote:
> > refactoring/error.cpp, line 32
> > <https://git.reviewboard.kde.org/r/124598/diff/2/?file=389565#file389565line32>
> >
> > What the... :)
> >
> > This code looks dubious (not really used to exception-safe code either). But where is `make_error_code` being used?
I heard that exceptions are disabled...
Clang also doesn't use exceptions. As a workaround `llvm::ErrorOr<T>` type was introduced.
Any enumeration type `T` is implicitly convertible to `llvm::ErrorOr<T>` provided that `std::is_error_code_enum<T>` has a constant member `value` equal to `true`. If so, converting constructor will invoke `make_error_code(T)` (using ADL) to create instance of `std::error_code` which will be carried by `llvm::ErrorOr<T>` and returned by `llvm::ErrorOr<T>::getError()`.
All of this is workaround of exception mechanism.
- Maciej
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124598/#review83394
-----------------------------------------------------------
On Sie 3, 2015, 5:52 po południu, Maciej Poleski wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124598/
> -----------------------------------------------------------
>
> (Updated Sie 3, 2015, 5:52 po południu)
>
>
> Review request for KDevelop.
>
>
> Repository: kdev-clang
>
>
> Description
> -------
>
> Extract variable refactoring
>
> Select some expression, right click, [Extract variable], type name of new variable to create, enjoy
>
> This is "local refactoring" - RefactoringContext is not used in `invoke` (thus it is fast)
>
>
> Diffs
> -----
>
> refactoring/CMakeLists.txt PRE-CREATION
> refactoring/contextmenumutator.cpp PRE-CREATION
> refactoring/error.h PRE-CREATION
> refactoring/error.cpp PRE-CREATION
> refactoring/extractvariablerefactoring.h PRE-CREATION
> refactoring/extractvariablerefactoring.cpp PRE-CREATION
> refactoring/refactoringcontext.h PRE-CREATION
> refactoring/refactoringcontext.cpp PRE-CREATION
> refactoring/refactoringmanager.cpp PRE-CREATION
> tests/CMakeLists.txt 20d17efae9a2a77cd7ef76bf7484ccfcf12e4cd8
> tests/test_extractvariable.h PRE-CREATION
> tests/test_extractvariable.cpp PRE-CREATION
>
> Diff: https://git.reviewboard.kde.org/r/124598/diff/
>
>
> Testing
> -------
>
> Tests included
>
>
> Thanks,
>
> Maciej Poleski
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150803/99326219/attachment.html>
More information about the KDevelop-devel
mailing list