Commit 0ff1f27374649a1d896d6bbe2910226b6381ad9c
1 parent
1ee22ec9
Fix catch by value
Showing
2 changed files
with
5 additions
and
5 deletions
.clang-tidy
| 1 | #Checks: '*,-clang-analyzer-alpha.*' | 1 | #Checks: '*,-clang-analyzer-alpha.*' |
| 2 | #Checks: '-*,google-readability-casting,llvm-namespace-comment,performance-unnecessary-value-param,llvm-include-order,misc-throw-by-value-catch-by-reference,readability-container-size-empty,google-runtime-references,modernize*' | 2 | #Checks: '-*,google-readability-casting,llvm-namespace-comment,performance-unnecessary-value-param,llvm-include-order,misc-throw-by-value-catch-by-reference,readability-container-size-empty,google-runtime-references,modernize*' |
| 3 | -Checks: '-*,llvm-namespace-comment,llvm-include-order,readability-container-size-empty' | 3 | +Checks: '-*,llvm-namespace-comment,llvm-include-order,readability-container-size-empty,misc-throw-by-value-catch-by-reference' |
| 4 | HeaderFilterRegex: '.*hpp' | 4 | HeaderFilterRegex: '.*hpp' |
| 5 | CheckOptions: | 5 | CheckOptions: |
| 6 | - key: readability-braces-around-statements.ShortStatementLines | 6 | - key: readability-braces-around-statements.ShortStatementLines |
include/CLI/TypeTools.hpp
| @@ -104,9 +104,9 @@ namespace detail { | @@ -104,9 +104,9 @@ namespace detail { | ||
| 104 | try{ | 104 | try{ |
| 105 | output = (T) std::stoll(input); | 105 | output = (T) std::stoll(input); |
| 106 | return true; | 106 | return true; |
| 107 | - } catch (std::invalid_argument) { | 107 | + } catch (const std::invalid_argument&) { |
| 108 | return false; | 108 | return false; |
| 109 | - } catch (std::out_of_range) { | 109 | + } catch (const std::out_of_range&) { |
| 110 | return false; | 110 | return false; |
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| @@ -117,9 +117,9 @@ namespace detail { | @@ -117,9 +117,9 @@ namespace detail { | ||
| 117 | try{ | 117 | try{ |
| 118 | output = (T) std::stold(input); | 118 | output = (T) std::stold(input); |
| 119 | return true; | 119 | return true; |
| 120 | - } catch (std::invalid_argument) { | 120 | + } catch (const std::invalid_argument&) { |
| 121 | return false; | 121 | return false; |
| 122 | - } catch (std::out_of_range) { | 122 | + } catch (const std::out_of_range&) { |
| 123 | return false; | 123 | return false; |
| 124 | } | 124 | } |
| 125 | } | 125 | } |