Commit fbd550f2 authored by Igor Britsky's avatar Igor Britsky Committed by Commit Bot

Fix GCC incomplete designated initialization bug

For GCC 8.4.0 is important to get all the first initializer in
designated init-list in case of implicit construction. Correct compile
if use explicit construction.

Error example (GCC 8.4.0):
../../components/autofill/core/browser/data_model/
autofill_structured_address_regex_provider.cc: In function 'std::__1::
string autofill::structured_address::{anonymous}::
ParseFirstMiddleLastNameExpression()':
../../components/autofill/core/browser/data_model/
autofill_structured_address_regex_provider.cc:270:61: error: no
matching function for call to 'CaptureTypeWithPattern(autofill::
ServerFieldType, const char [953], <brace-enclosed initializer list>)'

Bug: 819294
Change-Id: I6149c53fda0f5357f66eae56446d61f010bccb53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2506573Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/master@{#823941}
parent d455eb4d
......@@ -267,11 +267,12 @@ std::string ParseFirstMiddleLastNameExpression() {
return CaptureTypeWithPattern(
NAME_FULL,
{CaptureTypeWithPattern(NAME_HONORIFIC_PREFIX, kHonorificPrefixRe,
{.quantifier = MATCH_OPTIONAL}),
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_FIRST, kSingleWordRe,
{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_MIDDLE, kMultipleLazyWordsRe,
{.quantifier = MATCH_LAZY_OPTIONAL}),
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(
NAME_MIDDLE, kMultipleLazyWordsRe,
CaptureOptions{.quantifier = MATCH_LAZY_OPTIONAL}),
CaptureTypeWithPattern(NAME_LAST,
{kOptionalLastNamePrefixRe, kSingleWordRe}),
kOptionalLastNameSuffixRe});
......@@ -288,14 +289,15 @@ std::string ParseLastCommaFirstMiddleExpression() {
return CaptureTypeWithPattern(
NAME_FULL,
{CaptureTypeWithPattern(NAME_HONORIFIC_PREFIX, kHonorificPrefixRe,
{.quantifier = MATCH_OPTIONAL}),
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_LAST,
{kOptionalLastNamePrefixRe, kSingleWordRe},
{.separator = "\\s*,\\s*"}),
CaptureTypeWithPattern(NAME_FIRST, kSingleWordRe,
{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_MIDDLE, kMultipleLazyWordsRe,
{.quantifier = MATCH_LAZY_OPTIONAL})});
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(
NAME_MIDDLE, kMultipleLazyWordsRe,
CaptureOptions{.quantifier = MATCH_LAZY_OPTIONAL})});
}
// Returns an expression to parse an Hispanic/Latinx last name.
......@@ -313,7 +315,7 @@ std::string ParseHispanicLastNameExpression() {
{kOptionalLastNamePrefixRe, kSingleWordRe}),
CaptureTypeWithPattern(NAME_LAST_CONJUNCTION,
kHispanicLastNameConjunctionsRe,
{.quantifier = MATCH_OPTIONAL}),
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_LAST_SECOND,
{kOptionalLastNamePrefixRe, kSingleWordRe})});
}
......@@ -325,9 +327,10 @@ std::string ParseHispanicFullNameExpression() {
return CaptureTypeWithPattern(
NAME_FULL,
{CaptureTypeWithPattern(NAME_HONORIFIC_PREFIX, kHonorificPrefixRe,
{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_FIRST, kMultipleLazyWordsRe,
{.quantifier = MATCH_LAZY_OPTIONAL}),
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(
NAME_FIRST, kMultipleLazyWordsRe,
CaptureOptions{.quantifier = MATCH_LAZY_OPTIONAL}),
ParseHispanicLastNameExpression()});
}
......@@ -358,14 +361,15 @@ std::string ParseStreetNameHouseNumberExpression() {
CaptureTypeWithPattern(
ADDRESS_HOME_SUBPREMISE,
{
CaptureTypeWithPrefixedPattern(ADDRESS_HOME_FLOOR, kFloorAffixRe,
"(?:(\\d{0,3}\\w?))",
{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPrefixedPattern(
ADDRESS_HOME_FLOOR, kFloorAffixRe, "(?:(\\d{0,3}\\w?))",
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPrefixedPattern(
ADDRESS_HOME_APT_NUM, kApartmentNumberPrefix,
"(?:(\\d{0,3}\\w?))", {.quantifier = MATCH_OPTIONAL}),
"(?:(\\d{0,3}\\w?))",
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
},
{.quantifier = MATCH_OPTIONAL})});
CaptureOptions{.quantifier = MATCH_OPTIONAL})});
}
// Returns an expression to parse a street address into the street name, the
......@@ -392,12 +396,13 @@ std::string ParseStreetNameHouseNumberExpressionSuffixedFloor() {
{
CaptureTypeWithSuffixedPattern(
ADDRESS_HOME_FLOOR, "(?:(\\d{0,3}\\w?))", kFloorAffixRe,
{.quantifier = MATCH_OPTIONAL}),
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPrefixedPattern(
ADDRESS_HOME_APT_NUM, kApartmentNumberPrefix,
"(?:(\\d{0,3}\\w?))", {.quantifier = MATCH_OPTIONAL}),
"(?:(\\d{0,3}\\w?))",
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
},
{.quantifier = MATCH_OPTIONAL})});
CaptureOptions{.quantifier = MATCH_OPTIONAL})});
}
// Returns an expression to parse a street address into the street name, the
......@@ -417,14 +422,15 @@ std::string ParseHouseNumberStreetNameExpression() {
CaptureTypeWithPattern(
ADDRESS_HOME_SUBPREMISE,
{
CaptureTypeWithPrefixedPattern(ADDRESS_HOME_FLOOR, kFloorAffixRe,
"(?:(\\d{0,3}\\w?))",
{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPrefixedPattern(
ADDRESS_HOME_FLOOR, kFloorAffixRe, "(?:(\\d{0,3}\\w?))",
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPrefixedPattern(
ADDRESS_HOME_APT_NUM, kApartmentNumberPrefix,
"(?:(\\d{0,3}\\w?))", {.quantifier = MATCH_OPTIONAL}),
"(?:(\\d{0,3}\\w?))",
CaptureOptions{.quantifier = MATCH_OPTIONAL}),
},
{.quantifier = MATCH_OPTIONAL})});
CaptureOptions{.quantifier = MATCH_OPTIONAL})});
}
} // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment