Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
aeb5ad3c
Commit
aeb5ad3c
authored
Apr 08, 2019
by
Bruce Mitchener
Committed by
Victor Zverovich
Apr 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable [[noreturn]] some.
parent
28083954
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
25 deletions
+25
-25
include/fmt/chrono.h
include/fmt/chrono.h
+14
-14
include/fmt/core.h
include/fmt/core.h
+7
-1
include/fmt/format.h
include/fmt/format.h
+2
-2
test/format-impl-test.cc
test/format-impl-test.cc
+0
-6
test/gtest-extra-test.cc
test/gtest-extra-test.cc
+2
-2
No files found.
include/fmt/chrono.h
View file @
aeb5ad3c
...
...
@@ -348,32 +348,32 @@ FMT_CONSTEXPR const Char* parse_chrono_format(const Char* begin,
}
struct
chrono_format_checker
{
void
report_no_date
()
{
FMT_THROW
(
format_error
(
"no date"
));
}
FMT_NORETURN
void
report_no_date
()
{
FMT_THROW
(
format_error
(
"no date"
));
}
template
<
typename
Char
>
void
on_text
(
const
Char
*
,
const
Char
*
)
{}
void
on_abbr_weekday
()
{
report_no_date
();
}
void
on_full_weekday
()
{
report_no_date
();
}
void
on_dec0_weekday
(
numeric_system
)
{
report_no_date
();
}
void
on_dec1_weekday
(
numeric_system
)
{
report_no_date
();
}
void
on_abbr_month
()
{
report_no_date
();
}
void
on_full_month
()
{
report_no_date
();
}
FMT_NORETURN
void
on_abbr_weekday
()
{
report_no_date
();
}
FMT_NORETURN
void
on_full_weekday
()
{
report_no_date
();
}
FMT_NORETURN
void
on_dec0_weekday
(
numeric_system
)
{
report_no_date
();
}
FMT_NORETURN
void
on_dec1_weekday
(
numeric_system
)
{
report_no_date
();
}
FMT_NORETURN
void
on_abbr_month
()
{
report_no_date
();
}
FMT_NORETURN
void
on_full_month
()
{
report_no_date
();
}
void
on_24_hour
(
numeric_system
)
{}
void
on_12_hour
(
numeric_system
)
{}
void
on_minute
(
numeric_system
)
{}
void
on_second
(
numeric_system
)
{}
void
on_datetime
(
numeric_system
)
{
report_no_date
();
}
void
on_loc_date
(
numeric_system
)
{
report_no_date
();
}
void
on_loc_time
(
numeric_system
)
{
report_no_date
();
}
void
on_us_date
()
{
report_no_date
();
}
void
on_iso_date
()
{
report_no_date
();
}
FMT_NORETURN
void
on_datetime
(
numeric_system
)
{
report_no_date
();
}
FMT_NORETURN
void
on_loc_date
(
numeric_system
)
{
report_no_date
();
}
FMT_NORETURN
void
on_loc_time
(
numeric_system
)
{
report_no_date
();
}
FMT_NORETURN
void
on_us_date
()
{
report_no_date
();
}
FMT_NORETURN
void
on_iso_date
()
{
report_no_date
();
}
void
on_12_hour_time
()
{}
void
on_24_hour_time
()
{}
void
on_iso_time
()
{}
void
on_am_pm
()
{}
void
on_duration_value
()
{}
void
on_duration_unit
()
{}
void
on_utc_offset
()
{
report_no_date
();
}
void
on_tz_name
()
{
report_no_date
();
}
FMT_NORETURN
void
on_utc_offset
()
{
report_no_date
();
}
FMT_NORETURN
void
on_tz_name
()
{
report_no_date
();
}
};
template
<
typename
Int
>
inline
int
to_int
(
Int
value
)
{
...
...
include/fmt/core.h
View file @
aeb5ad3c
...
...
@@ -143,6 +143,12 @@
# endif
#endif
#if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn)
# define FMT_NORETURN [[noreturn]]
#else
# define FMT_NORETURN
#endif
#ifndef FMT_DEPRECATED
# if (FMT_HAS_CPP_ATTRIBUTE(deprecated) && __cplusplus >= 201402L) || \
FMT_MSC_VER >= 1900
...
...
@@ -350,7 +356,7 @@ struct error_handler {
FMT_CONSTEXPR
error_handler
(
const
error_handler
&
)
{}
// This function is intentionally not constexpr to give a compile-time error.
FMT_API
void
on_error
(
const
char
*
message
);
FMT_API
FMT_NORETURN
void
on_error
(
const
char
*
message
);
};
// GCC 4.6.x cannot expand `T...`.
...
...
include/fmt/format.h
View file @
aeb5ad3c
...
...
@@ -2621,7 +2621,7 @@ template <typename Range> class basic_writer {
num_writer
{
abs_value
,
size
,
sep
});
}
void
on_error
()
{
FMT_THROW
(
format_error
(
"invalid type specifier"
));
}
FMT_NORETURN
void
on_error
()
{
FMT_THROW
(
format_error
(
"invalid type specifier"
));
}
};
// Writes a formatted integer.
...
...
@@ -2858,7 +2858,7 @@ struct float_spec_handler {
if
(
type
==
'A'
)
upper
=
true
;
}
void
on_error
()
{
FMT_THROW
(
format_error
(
"invalid type specifier"
));
}
FMT_NORETURN
void
on_error
()
{
FMT_THROW
(
format_error
(
"invalid type specifier"
));
}
};
template
<
typename
Range
>
...
...
test/format-impl-test.cc
View file @
aeb5ad3c
...
...
@@ -22,12 +22,6 @@
#undef max
#if FMT_HAS_CPP_ATTRIBUTE(noreturn)
# define FMT_NORETURN [[noreturn]]
#else
# define FMT_NORETURN
#endif
using
fmt
::
internal
::
fp
;
template
<
bool
is_iec559
>
void
test_construct_from_double
()
{
...
...
test/gtest-extra-test.cc
View file @
aeb5ad3c
...
...
@@ -52,9 +52,9 @@ int SingleEvaluationTest::b_;
void
do_nothing
()
{}
void
throw_exception
()
{
throw
std
::
runtime_error
(
"test"
);
}
FMT_NORETURN
void
throw_exception
()
{
throw
std
::
runtime_error
(
"test"
);
}
void
throw_system_error
()
{
throw
fmt
::
system_error
(
EDOM
,
"test"
);
}
FMT_NORETURN
void
throw_system_error
()
{
throw
fmt
::
system_error
(
EDOM
,
"test"
);
}
// Tests that when EXPECT_THROW_MSG fails, it evaluates its message argument
// exactly once.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment