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() { ...@@ -267,11 +267,12 @@ std::string ParseFirstMiddleLastNameExpression() {
return CaptureTypeWithPattern( return CaptureTypeWithPattern(
NAME_FULL, NAME_FULL,
{CaptureTypeWithPattern(NAME_HONORIFIC_PREFIX, kHonorificPrefixRe, {CaptureTypeWithPattern(NAME_HONORIFIC_PREFIX, kHonorificPrefixRe,
{.quantifier = MATCH_OPTIONAL}), CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_FIRST, kSingleWordRe, CaptureTypeWithPattern(NAME_FIRST, kSingleWordRe,
{.quantifier = MATCH_OPTIONAL}), CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_MIDDLE, kMultipleLazyWordsRe, CaptureTypeWithPattern(
{.quantifier = MATCH_LAZY_OPTIONAL}), NAME_MIDDLE, kMultipleLazyWordsRe,
CaptureOptions{.quantifier = MATCH_LAZY_OPTIONAL}),
CaptureTypeWithPattern(NAME_LAST, CaptureTypeWithPattern(NAME_LAST,
{kOptionalLastNamePrefixRe, kSingleWordRe}), {kOptionalLastNamePrefixRe, kSingleWordRe}),
kOptionalLastNameSuffixRe}); kOptionalLastNameSuffixRe});
...@@ -288,14 +289,15 @@ std::string ParseLastCommaFirstMiddleExpression() { ...@@ -288,14 +289,15 @@ std::string ParseLastCommaFirstMiddleExpression() {
return CaptureTypeWithPattern( return CaptureTypeWithPattern(
NAME_FULL, NAME_FULL,
{CaptureTypeWithPattern(NAME_HONORIFIC_PREFIX, kHonorificPrefixRe, {CaptureTypeWithPattern(NAME_HONORIFIC_PREFIX, kHonorificPrefixRe,
{.quantifier = MATCH_OPTIONAL}), CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_LAST, CaptureTypeWithPattern(NAME_LAST,
{kOptionalLastNamePrefixRe, kSingleWordRe}, {kOptionalLastNamePrefixRe, kSingleWordRe},
{.separator = "\\s*,\\s*"}), {.separator = "\\s*,\\s*"}),
CaptureTypeWithPattern(NAME_FIRST, kSingleWordRe, CaptureTypeWithPattern(NAME_FIRST, kSingleWordRe,
{.quantifier = MATCH_OPTIONAL}), CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_MIDDLE, kMultipleLazyWordsRe, CaptureTypeWithPattern(
{.quantifier = MATCH_LAZY_OPTIONAL})}); NAME_MIDDLE, kMultipleLazyWordsRe,
CaptureOptions{.quantifier = MATCH_LAZY_OPTIONAL})});
} }
// Returns an expression to parse an Hispanic/Latinx last name. // Returns an expression to parse an Hispanic/Latinx last name.
...@@ -313,7 +315,7 @@ std::string ParseHispanicLastNameExpression() { ...@@ -313,7 +315,7 @@ std::string ParseHispanicLastNameExpression() {
{kOptionalLastNamePrefixRe, kSingleWordRe}), {kOptionalLastNamePrefixRe, kSingleWordRe}),
CaptureTypeWithPattern(NAME_LAST_CONJUNCTION, CaptureTypeWithPattern(NAME_LAST_CONJUNCTION,
kHispanicLastNameConjunctionsRe, kHispanicLastNameConjunctionsRe,
{.quantifier = MATCH_OPTIONAL}), CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_LAST_SECOND, CaptureTypeWithPattern(NAME_LAST_SECOND,
{kOptionalLastNamePrefixRe, kSingleWordRe})}); {kOptionalLastNamePrefixRe, kSingleWordRe})});
} }
...@@ -325,9 +327,10 @@ std::string ParseHispanicFullNameExpression() { ...@@ -325,9 +327,10 @@ std::string ParseHispanicFullNameExpression() {
return CaptureTypeWithPattern( return CaptureTypeWithPattern(
NAME_FULL, NAME_FULL,
{CaptureTypeWithPattern(NAME_HONORIFIC_PREFIX, kHonorificPrefixRe, {CaptureTypeWithPattern(NAME_HONORIFIC_PREFIX, kHonorificPrefixRe,
{.quantifier = MATCH_OPTIONAL}), CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPattern(NAME_FIRST, kMultipleLazyWordsRe, CaptureTypeWithPattern(
{.quantifier = MATCH_LAZY_OPTIONAL}), NAME_FIRST, kMultipleLazyWordsRe,
CaptureOptions{.quantifier = MATCH_LAZY_OPTIONAL}),
ParseHispanicLastNameExpression()}); ParseHispanicLastNameExpression()});
} }
...@@ -358,14 +361,15 @@ std::string ParseStreetNameHouseNumberExpression() { ...@@ -358,14 +361,15 @@ std::string ParseStreetNameHouseNumberExpression() {
CaptureTypeWithPattern( CaptureTypeWithPattern(
ADDRESS_HOME_SUBPREMISE, ADDRESS_HOME_SUBPREMISE,
{ {
CaptureTypeWithPrefixedPattern(ADDRESS_HOME_FLOOR, kFloorAffixRe, CaptureTypeWithPrefixedPattern(
"(?:(\\d{0,3}\\w?))", ADDRESS_HOME_FLOOR, kFloorAffixRe, "(?:(\\d{0,3}\\w?))",
{.quantifier = MATCH_OPTIONAL}), CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPrefixedPattern( CaptureTypeWithPrefixedPattern(
ADDRESS_HOME_APT_NUM, kApartmentNumberPrefix, 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 // Returns an expression to parse a street address into the street name, the
...@@ -392,12 +396,13 @@ std::string ParseStreetNameHouseNumberExpressionSuffixedFloor() { ...@@ -392,12 +396,13 @@ std::string ParseStreetNameHouseNumberExpressionSuffixedFloor() {
{ {
CaptureTypeWithSuffixedPattern( CaptureTypeWithSuffixedPattern(
ADDRESS_HOME_FLOOR, "(?:(\\d{0,3}\\w?))", kFloorAffixRe, ADDRESS_HOME_FLOOR, "(?:(\\d{0,3}\\w?))", kFloorAffixRe,
{.quantifier = MATCH_OPTIONAL}), CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPrefixedPattern( CaptureTypeWithPrefixedPattern(
ADDRESS_HOME_APT_NUM, kApartmentNumberPrefix, 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 // Returns an expression to parse a street address into the street name, the
...@@ -417,14 +422,15 @@ std::string ParseHouseNumberStreetNameExpression() { ...@@ -417,14 +422,15 @@ std::string ParseHouseNumberStreetNameExpression() {
CaptureTypeWithPattern( CaptureTypeWithPattern(
ADDRESS_HOME_SUBPREMISE, ADDRESS_HOME_SUBPREMISE,
{ {
CaptureTypeWithPrefixedPattern(ADDRESS_HOME_FLOOR, kFloorAffixRe, CaptureTypeWithPrefixedPattern(
"(?:(\\d{0,3}\\w?))", ADDRESS_HOME_FLOOR, kFloorAffixRe, "(?:(\\d{0,3}\\w?))",
{.quantifier = MATCH_OPTIONAL}), CaptureOptions{.quantifier = MATCH_OPTIONAL}),
CaptureTypeWithPrefixedPattern( CaptureTypeWithPrefixedPattern(
ADDRESS_HOME_APT_NUM, kApartmentNumberPrefix, 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 } // 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