-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #454: Added missing support for noexcept transformation.
The first implementation left member functions untransformed. This patch adds support for them.
- Loading branch information
1 parent
c1be4f8
commit 07fc07e
Showing
4 changed files
with
90 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// cmdlineinsights:-edu-show-noexcept | ||
|
||
struct Data | ||
{ | ||
int i; | ||
double d; | ||
double func() const noexcept{ | ||
// should't also this show a try ... catch block? | ||
return d*i; | ||
} | ||
}; | ||
|
||
|
||
int func() noexcept { | ||
return 4*6; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <exception> // for noexcept transformation | ||
// cmdlineinsights:-edu-show-noexcept | ||
|
||
struct Data | ||
{ | ||
int i; | ||
double d; | ||
inline double func() const noexcept | ||
{ | ||
try { | ||
return this->d * static_cast<double>(this->i); | ||
} catch(...) { | ||
std::terminate(); | ||
} | ||
} | ||
|
||
}; | ||
|
||
|
||
|
||
|
||
int func() noexcept | ||
{ | ||
try { | ||
return 4 * 6; | ||
} catch(...) { | ||
std::terminate(); | ||
} | ||
} | ||
|