Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
djinni
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
cpp-libs
djinni
Commits
6986cc43
Unverified
Commit
6986cc43
authored
Jul 18, 2018
by
Xianwen Chen
Committed by
GitHub
Jul 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error ‘constexpr’ needed for in-class initialization of static data member (#387)
parent
9d118948
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
src/source/CppGenerator.scala
src/source/CppGenerator.scala
+1
-1
test-suite/generated-src/cpp/constants.cpp
test-suite/generated-src/cpp/constants.cpp
+8
-8
test-suite/generated-src/cpp/constants_interface.cpp
test-suite/generated-src/cpp/constants_interface.cpp
+7
-7
No files found.
src/source/CppGenerator.scala
View file @
6986cc43
...
...
@@ -175,7 +175,7 @@ class CppGenerator(spec: Spec) extends Generator(spec) {
for
(
c
<-
consts
)
{
skipFirst
{
w
.
wl
}
if
(
shouldConstexpr
(
c
)){
w
.
w
(
s
"${marshal.fieldType(c.ty)} const $selfName::${idCpp.const(c.ident)}"
)
w
.
w
(
s
"${marshal.fieldType(c.ty)} const
expr
$selfName::${idCpp.const(c.ident)}"
)
}
else
{
w
.
w
(
s
"${marshal.fieldType(c.ty)} const $selfName::${idCpp.const(c.ident)} = "
)
writeCppConst
(
w
,
c
.
ty
,
c
.
value
)
...
...
test-suite/generated-src/cpp/constants.cpp
View file @
6986cc43
...
...
@@ -5,19 +5,19 @@
namespace
testsuite
{
bool
const
Constants
::
BOOL_CONSTANT
;
bool
const
expr
Constants
::
BOOL_CONSTANT
;
int8_t
const
Constants
::
I8_CONSTANT
;
int8_t
const
expr
Constants
::
I8_CONSTANT
;
int16_t
const
Constants
::
I16_CONSTANT
;
int16_t
const
expr
Constants
::
I16_CONSTANT
;
int32_t
const
Constants
::
I32_CONSTANT
;
int32_t
const
expr
Constants
::
I32_CONSTANT
;
int64_t
const
Constants
::
I64_CONSTANT
;
int64_t
const
expr
Constants
::
I64_CONSTANT
;
float
const
Constants
::
F32_CONSTANT
;
float
const
expr
Constants
::
F32_CONSTANT
;
double
const
Constants
::
F64_CONSTANT
;
double
const
expr
Constants
::
F64_CONSTANT
;
std
::
experimental
::
optional
<
bool
>
const
Constants
::
OPT_BOOL_CONSTANT
=
true
;
...
...
@@ -41,6 +41,6 @@ ConstantRecord const Constants::OBJECT_CONSTANT = ConstantRecord(
Constants
::
I32_CONSTANT
/* some_integer */
,
Constants
::
STRING_CONSTANT
/* some_string */
);
bool
const
Constants
::
DUMMY
;
bool
const
expr
Constants
::
DUMMY
;
}
// namespace testsuite
test-suite/generated-src/cpp/constants_interface.cpp
View file @
6986cc43
...
...
@@ -6,19 +6,19 @@
namespace
testsuite
{
bool
const
ConstantsInterface
::
BOOL_CONSTANT
;
bool
const
expr
ConstantsInterface
::
BOOL_CONSTANT
;
int8_t
const
ConstantsInterface
::
I8_CONSTANT
;
int8_t
const
expr
ConstantsInterface
::
I8_CONSTANT
;
int16_t
const
ConstantsInterface
::
I16_CONSTANT
;
int16_t
const
expr
ConstantsInterface
::
I16_CONSTANT
;
int32_t
const
ConstantsInterface
::
I32_CONSTANT
;
int32_t
const
expr
ConstantsInterface
::
I32_CONSTANT
;
int64_t
const
ConstantsInterface
::
I64_CONSTANT
;
int64_t
const
expr
ConstantsInterface
::
I64_CONSTANT
;
float
const
ConstantsInterface
::
F32_CONSTANT
;
float
const
expr
ConstantsInterface
::
F32_CONSTANT
;
double
const
ConstantsInterface
::
F64_CONSTANT
;
double
const
expr
ConstantsInterface
::
F64_CONSTANT
;
std
::
experimental
::
optional
<
bool
>
const
ConstantsInterface
::
OPT_BOOL_CONSTANT
=
true
;
...
...
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