Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
4116912c
Commit
4116912c
authored
Oct 01, 2019
by
Ross Younger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use C++17 fallthrough tag instead of disabling warning
Signed-off-by:
Ross Younger
<
crazyscot@gmail.com
>
parent
d67a69a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
regex.h
include/rapidjson/internal/regex.h
+3
-4
rapidjson.h
include/rapidjson/rapidjson.h
+13
-0
No files found.
include/rapidjson/internal/regex.h
View file @
4116912c
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
padded
)
RAPIDJSON_DIAG_OFF
(
padded
)
RAPIDJSON_DIAG_OFF
(
switch
-
enum
)
RAPIDJSON_DIAG_OFF
(
switch
-
enum
)
RAPIDJSON_DIAG_OFF
(
implicit
-
fallthrough
)
#elif defined(_MSC_VER)
#elif defined(_MSC_VER)
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
4512
)
// assignment operator could not be generated
RAPIDJSON_DIAG_OFF
(
4512
)
// assignment operator could not be generated
...
@@ -32,9 +31,6 @@ RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
...
@@ -32,9 +31,6 @@ RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
#ifdef __GNUC__
#ifdef __GNUC__
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
effc
++
)
RAPIDJSON_DIAG_OFF
(
effc
++
)
#if __GNUC__ >= 7
RAPIDJSON_DIAG_OFF
(
implicit
-
fallthrough
)
#endif
#endif
#endif
#ifndef RAPIDJSON_REGEX_VERBOSE
#ifndef RAPIDJSON_REGEX_VERBOSE
...
@@ -291,6 +287,7 @@ private:
...
@@ -291,6 +287,7 @@ private:
if
(
!
CharacterEscape
(
ds
,
&
codepoint
))
if
(
!
CharacterEscape
(
ds
,
&
codepoint
))
return
;
// Unsupported escape character
return
;
// Unsupported escape character
// fall through to default
// fall through to default
RAPIDJSON_DELIBERATE_FALLTHROUGH
;
default
:
// Pattern character
default
:
// Pattern character
PushOperand
(
operandStack
,
codepoint
);
PushOperand
(
operandStack
,
codepoint
);
...
@@ -520,6 +517,7 @@ private:
...
@@ -520,6 +517,7 @@ private:
else
if
(
!
CharacterEscape
(
ds
,
&
codepoint
))
else
if
(
!
CharacterEscape
(
ds
,
&
codepoint
))
return
false
;
return
false
;
// fall through to default
// fall through to default
RAPIDJSON_DELIBERATE_FALLTHROUGH
;
default
:
default
:
switch
(
step
)
{
switch
(
step
)
{
...
@@ -529,6 +527,7 @@ private:
...
@@ -529,6 +527,7 @@ private:
break
;
break
;
}
}
// fall through to step 0 for other characters
// fall through to step 0 for other characters
RAPIDJSON_DELIBERATE_FALLTHROUGH
;
case
0
:
case
0
:
{
{
...
...
include/rapidjson/rapidjson.h
View file @
4116912c
...
@@ -591,6 +591,19 @@ RAPIDJSON_NAMESPACE_END
...
@@ -591,6 +591,19 @@ RAPIDJSON_NAMESPACE_END
#endif
#endif
#endif // RAPIDJSON_HAS_CXX11_RANGE_FOR
#endif // RAPIDJSON_HAS_CXX11_RANGE_FOR
///////////////////////////////////////////////////////////////////////////////
// C++17 features
#if defined(__has_cpp_attribute)
# if __has_cpp_attribute(fallthrough)
# define RAPIDJSON_DELIBERATE_FALLTHROUGH [[fallthrough]]
# else
# define RAPIDJSON_DELIBERATE_FALLTHROUGH
# endif
#else
# define RAPIDJSON_DELIBERATE_FALLTHROUGH
#endif
//!@endcond
//!@endcond
//! Assertion (in non-throwing contexts).
//! Assertion (in non-throwing contexts).
...
...
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