Fix nullable string example failure on gcc7 #2266
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The nullable string array example(nullable_attribute.cc) fails on CentOS7/gcc7.3 with an incomplete query. Finally I found that it is not a bug from gcc7. The bug for calculating max_size_validity caused that problem. When we add three attributes a1,a2,a3, the unordered_map buffer still keep in that order gcc4.8, clang, and vc2015. But in gcc 7, a2 becomes the first when we try to iterate. The incomplete query is not found when we use gcc4.8, clang or vc2015, since a1 is a fixed size attribute and a1 still shows to be the first in gcc4.8 and other compilers. If our example use more attributes, the incomplete query could also happen for gcc4.8, clang and vc2015. This incomplete query can also happen for other kinds of variable size attributes(such as vector). In this branch, I also fixed some warnings from gcc compiler when we provided unused parameters for default constructors and assign operators.
TYPE: BUG
DESC: The bug for calculating max_size_validity for var_size attribute caused incomplete query