Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved exception infrastructure #676

Merged
merged 2 commits into from
Apr 18, 2017
Merged

Improved exception infrastructure #676

merged 2 commits into from
Apr 18, 2017

Conversation

coatless
Copy link
Contributor

This is PR 2 of 3.

Contained within this PR is the necessary upgrade to the exception infrastructure to proceed with improving internal exception messages.

The third PR aims to provide the improved internal exception messages based on the proposal table in #184.

(The first PR was the upstream refresh of the tinyformat library.)


Changes:

  • Added local mod in tinyformat to enable variadic templates if C++11 is detected.
  • Created a C++11 exception message version using variadic templates for Rcpp::stop, Rcpp::warning, and RCPP_ADVANCED_EXCEPTION_CLASS
  • Added C++98 exception message version using generated macro arguments.
  • Extracted generated Rcpp::stop and Rcpp::warning functions from exception.h and moved them into C++98 exception header
  • Modified RCPP_EXCEPTION_CLASS macro to have a default ctor that returns a default constructed string to allow for promotion without breaking present use.
  • Promoted no_such_slot and not_a_closure to use RCPP_EXCEPTION_CLASS from RCPP_SIMPLE_EXCEPTION_CLASS.
  • Promoted index_out_of_bounds and not_compatible to use RCPP_ADVANCED_EXCEPTION_CLASS.
  • Flagged no_such_field and reference_creation_class for potential removal.

@codecov-io
Copy link

codecov-io commented Apr 17, 2017

Codecov Report

Merging #676 into master will decrease coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #676      +/-   ##
==========================================
- Coverage   92.91%   92.88%   -0.03%     
==========================================
  Files          65       65              
  Lines        3302     3303       +1     
==========================================
  Hits         3068     3068              
- Misses        234      235       +1
Impacted Files Coverage Δ
inst/include/Rcpp/exceptions.h 50% <50%> (-50%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 052089b...b022854. Read the comment docs.

Copy link
Member

@eddelbuettel eddelbuettel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me at first glance.

Reverse depend check running too.

@eddelbuettel
Copy link
Member

eddelbuettel commented Apr 17, 2017

It seems to make some noise in other project though ... when -pedantic -Wextra is used. Falling back to -Wno-unused quiets it down a little.

@eddelbuettel eddelbuettel merged commit 25c2369 into RcppCore:master Apr 18, 2017
@coatless
Copy link
Contributor Author

Modifications to the C++98 macro to remove ; were done in:

e08d088 and 138454e

@coatless coatless deleted the feature/improved-exception-messages-v2 branch August 16, 2017 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants