summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorsssooonnnggg <sssooonnnggg111@gmail.com>2022-11-29 12:59:53 +0800
committerGitHub <noreply@github.com>2022-11-29 04:59:53 +0000
commitad6054c60079c0b813f3354a822ffbf1b4a70ad0 (patch)
tree8976765347a78c279552ab15c5be4ce1b173cfdb /include
parentc3a01c7228b491ef391a56aabeac85b15826a459 (diff)
downloadflatbuffers-ad6054c60079c0b813f3354a822ffbf1b4a70ad0.tar.gz
flatbuffers-ad6054c60079c0b813f3354a822ffbf1b4a70ad0.tar.bz2
flatbuffers-ad6054c60079c0b813f3354a822ffbf1b4a70ad0.zip
chore: emit more reasonable error message when using incomplete type in struct (#7678)
Co-authored-by: Derek Bailey <derekbailey@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/flatbuffers/idl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h
index a07f62a3..f6384894 100644
--- a/include/flatbuffers/idl.h
+++ b/include/flatbuffers/idl.h
@@ -473,6 +473,10 @@ inline bool IsStruct(const Type &type) {
return type.base_type == BASE_TYPE_STRUCT && type.struct_def->fixed;
}
+inline bool IsIncompleteStruct(const Type &type) {
+ return type.base_type == BASE_TYPE_STRUCT && type.struct_def->predecl;
+}
+
inline bool IsTable(const Type &type) {
return type.base_type == BASE_TYPE_STRUCT && !type.struct_def->fixed;
}