summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCasper <casperneo@uchicago.edu>2020-10-07 09:46:09 -0700
committerGitHub <noreply@github.com>2020-10-07 09:46:09 -0700
commit3359e3042fd1dd947c4093b90ecce24d1839fbdd (patch)
treed14c07516ba810e5ace6bdd84eb4d9120e2d05c2 /src
parent187a4787f91f02346ba74fc6bf93e9c7f3e54159 (diff)
downloadflatbuffers-3359e3042fd1dd947c4093b90ecce24d1839fbdd.tar.gz
flatbuffers-3359e3042fd1dd947c4093b90ecce24d1839fbdd.tar.bz2
flatbuffers-3359e3042fd1dd947c4093b90ecce24d1839fbdd.zip
Moved C++ to optional_scalars2 and added some tests. (#6162)
* Moved C++ to optional_scalars2 and added some tests. Also deleted unused optional_scalars_generated.lobster * Fixed whitespece in C++ gencode & fixed BUILD file * Moved C++ onto optional_scalars2 in the .bat file Co-authored-by: Casper Neo <cneo@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/idl_gen_cpp.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/idl_gen_cpp.cpp b/src/idl_gen_cpp.cpp
index dabc385b..9cb01696 100644
--- a/src/idl_gen_cpp.cpp
+++ b/src/idl_gen_cpp.cpp
@@ -1,4 +1,4 @@
-/*
+ /*
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -1650,7 +1650,7 @@ class CppGenerator : public BaseGenerator {
const auto &type = field.value.type;
code_.SetValue("PARAM_VALUE", GetDefaultScalarValue(field, false));
if (field.IsScalarOptional())
- code_.SetValue("PARAM_TYPE", GenOptionalDecl(type));
+ code_.SetValue("PARAM_TYPE", GenOptionalDecl(type) + " ");
else
code_.SetValue("PARAM_TYPE", GenTypeWire(type, " ", true));
}