Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
61e464bc
Unverified
Commit
61e464bc
authored
Jan 05, 2023
by
James Lamb
Committed by
GitHub
Jan 05, 2023
Browse files
[ci] [R-package] fix clang 15 warning about unqualified calls (fixes #5661) (#5662)
parent
de10d0d9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
9 deletions
+48
-9
.github/workflows/r_package.yml
.github/workflows/r_package.yml
+40
-0
src/io/json11.cpp
src/io/json11.cpp
+8
-9
No files found.
.github/workflows/r_package.yml
View file @
61e464bc
...
...
@@ -240,6 +240,46 @@ jobs:
with
:
fetch-depth
:
5
submodules
:
true
-
name
:
update to clang
15
shell
:
bash
run
:
|
# remove clang stuff that comes installed in the image
apt-get autoremove -y --purge \
clang-* \
libclang-* \
libunwind-* \
llvm-*
#
# replace it all with clang-15
apt-get update -y
apt-get install --no-install-recommends -y \
gnupg \
lsb-release \
software-properties-common \
wget
#
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
#
add-apt-repository "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-15 main"
apt-get install -y --no-install-recommends \
clang-15 \
clangd-15 \
clang-format-15 \
clang-tidy-15 \
clang-tools-15 \
lldb-15 \
lld-15 \
llvm-15-dev \
llvm-15-tools \
libomp-15-dev \
libc++-15-dev \
libc++abi-15-dev \
libclang-common-15-dev \
libclang-15-dev \
libclang-cpp15-dev \
libunwind-15-dev
# overwrite everything in /usr/bin with the new v15 versions
cp --remove-destination /usr/lib/llvm-15/bin/* /usr/bin/
-
name
:
Install packages and run tests
shell
:
bash
run
:
|
...
...
src/io/json11.cpp
View file @
61e464bc
...
...
@@ -34,7 +34,6 @@ static const int max_depth = 200;
using
std
::
initializer_list
;
using
std
::
make_shared
;
using
std
::
map
;
using
std
::
move
;
using
std
::
string
;
using
std
::
vector
;
...
...
@@ -147,7 +146,7 @@ class Value : public JsonValue {
protected:
// Constructors
explicit
Value
(
const
T
&
value
)
:
m_value
(
value
)
{}
explicit
Value
(
T
&&
value
)
:
m_value
(
move
(
value
))
{}
explicit
Value
(
T
&&
value
)
:
m_value
(
std
::
move
(
value
))
{}
// Get type tag
Json
::
Type
type
()
const
override
{
return
tag
;
}
...
...
@@ -204,7 +203,7 @@ class JsonString final : public Value<Json::STRING, string> {
public:
explicit
JsonString
(
const
string
&
value
)
:
Value
(
value
)
{}
explicit
JsonString
(
string
&&
value
)
:
Value
(
move
(
value
))
{}
explicit
JsonString
(
string
&&
value
)
:
Value
(
std
::
move
(
value
))
{}
};
class
JsonArray
final
:
public
Value
<
Json
::
ARRAY
,
Json
::
array
>
{
...
...
@@ -213,7 +212,7 @@ class JsonArray final : public Value<Json::ARRAY, Json::array> {
public:
explicit
JsonArray
(
const
Json
::
array
&
value
)
:
Value
(
value
)
{}
explicit
JsonArray
(
Json
::
array
&&
value
)
:
Value
(
move
(
value
))
{}
explicit
JsonArray
(
Json
::
array
&&
value
)
:
Value
(
std
::
move
(
value
))
{}
};
class
JsonObject
final
:
public
Value
<
Json
::
OBJECT
,
Json
::
object
>
{
...
...
@@ -222,7 +221,7 @@ class JsonObject final : public Value<Json::OBJECT, Json::object> {
public:
explicit
JsonObject
(
const
Json
::
object
&
value
)
:
Value
(
value
)
{}
explicit
JsonObject
(
Json
::
object
&&
value
)
:
Value
(
move
(
value
))
{}
explicit
JsonObject
(
Json
::
object
&&
value
)
:
Value
(
std
::
move
(
value
))
{}
};
class
JsonNull
final
:
public
Value
<
Json
::
NUL
,
NullStruct
>
{
...
...
@@ -265,15 +264,15 @@ Json::Json(double value) : m_ptr(make_shared<JsonDouble>(value)) {}
Json
::
Json
(
int
value
)
:
m_ptr
(
make_shared
<
JsonInt
>
(
value
))
{}
Json
::
Json
(
bool
value
)
:
m_ptr
(
value
?
statics
().
t
:
statics
().
f
)
{}
Json
::
Json
(
const
string
&
value
)
:
m_ptr
(
make_shared
<
JsonString
>
(
value
))
{}
Json
::
Json
(
string
&&
value
)
:
m_ptr
(
make_shared
<
JsonString
>
(
move
(
value
)))
{}
Json
::
Json
(
string
&&
value
)
:
m_ptr
(
make_shared
<
JsonString
>
(
std
::
move
(
value
)))
{}
Json
::
Json
(
const
char
*
value
)
:
m_ptr
(
make_shared
<
JsonString
>
(
value
))
{}
Json
::
Json
(
const
Json
::
array
&
values
)
:
m_ptr
(
make_shared
<
JsonArray
>
(
values
))
{}
Json
::
Json
(
Json
::
array
&&
values
)
:
m_ptr
(
make_shared
<
JsonArray
>
(
move
(
values
)))
{}
:
m_ptr
(
make_shared
<
JsonArray
>
(
std
::
move
(
values
)))
{}
Json
::
Json
(
const
Json
::
object
&
values
)
:
m_ptr
(
make_shared
<
JsonObject
>
(
values
))
{}
Json
::
Json
(
Json
::
object
&&
values
)
:
m_ptr
(
make_shared
<
JsonObject
>
(
move
(
values
)))
{}
:
m_ptr
(
make_shared
<
JsonObject
>
(
std
::
move
(
values
)))
{}
/* * * * * * * * * * * * * * * * * * * *
* Accessors
...
...
@@ -378,7 +377,7 @@ struct JsonParser final {
*
* Mark this parse as failed.
*/
Json
fail
(
string
&&
msg
)
{
return
fail
(
move
(
msg
),
Json
());
}
Json
fail
(
string
&&
msg
)
{
return
fail
(
std
::
move
(
msg
),
Json
());
}
template
<
typename
T
>
T
fail
(
string
&&
msg
,
const
T
err_ret
)
{
...
...
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