summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-11-08 12:33:50 +0000
committerMoonchild <moonchild@palemoon.org>2023-11-08 12:33:50 +0000
commit7f99af410107ac25fd78c223dd2cbe5995f29656 (patch)
tree6f4ca78744cdeb3091338a3fd1fd1a71e1a5ce30
parent7181c37a3985d14b791c233561f48a927bbc6463 (diff)
parente6f9b299513446b6b6b80d172db8e72772704ffa (diff)
downloaduxp-7f99af410107ac25fd78c223dd2cbe5995f29656.tar.gz
Merge pull request 'Switch our tree to building with c++17' (#2372) from 2281-c++17-buildwork into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2372
-rw-r--r--CLOBBER2
-rw-r--r--build/moz.configure/toolchain.configure19
-rw-r--r--build/moz.configure/warnings.configure2
-rwxr-xr-xgfx/angle/src/compiler/preprocessor/Tokenizer.cpp26
-rwxr-xr-xgfx/angle/src/compiler/translator/glslang_lex.cpp26
-rw-r--r--js/src/jsapi.h13
-rw-r--r--js/src/vm/TypedArrayObject.cpp2
-rw-r--r--media/webrtc/trunk/testing/gtest/include/gtest/gtest-printers.h39
-rw-r--r--media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h75
-rw-r--r--media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump11
-rw-r--r--memory/mozalloc/mozalloc.h9
-rw-r--r--memory/mozalloc/throw_gcc.h5
-rw-r--r--mfbt/Compression.cpp12
-rw-r--r--mfbt/Span.h9
-rw-r--r--mfbt/moz.build13
-rw-r--r--mfbt/objs.mozbuild2
-rw-r--r--toolkit/components/protobuf/src/google/protobuf/repeated_field.h41
-rw-r--r--xpcom/glue/nsTArray.h6
18 files changed, 153 insertions, 159 deletions
diff --git a/CLOBBER b/CLOBBER
index 346b3dc7ee..0b54a80712 100644
--- a/CLOBBER
+++ b/CLOBBER
@@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
-Removal of SIMD.js and associated scalar types requires CLOBBER. (Issue #2307)
+Switching to C++17 requires CLOBBER to pick up compiler conf. (Issue #2281)
diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
index cc0540ea1c..40b87cf626 100644
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -340,17 +340,16 @@ def check_compiler(compiler, language, target):
if info.type in ('clang-cl', 'clang', 'gcc'):
append_flag('-std=gnu99')
- # Note: this is a strict version check because we used to always add
- # -std=gnu++14.
- cxx14_version = 201402
+ cxx17_version = 201703
if info.language == 'C++':
- if info.type in ('clang', 'gcc') and info.language_version != cxx14_version:
- append_flag('-std=gnu++14')
- # MSVC 2015 headers include C++14 features, but don't guard them
- # with appropriate checks.
- if info.type == 'clang-cl' and info.language_version != cxx14_version:
- append_flag('-std=c++14')
- # MSVC from 2015 on defaults to C++14.
+ if info.language_version != cxx17_version:
+ # Compiler doesn't default to C++17, so add the appropriate flag.
+ if info.type in ('clang', 'gcc'):
+ # We're on Clang or GCC, enable C++17 and add GNU extensions.
+ append_flag('-std=gnu++17')
+ else:
+ # We're on MSVC; enable C++17 language mode.
+ append_flag('-std:c++17')
# We force clang-cl to emulate Visual C++ 2015 Update 3 with fallback to
# cl.exe.
diff --git a/build/moz.configure/warnings.configure b/build/moz.configure/warnings.configure
index 2edf1748ad..0704f94a09 100644
--- a/build/moz.configure/warnings.configure
+++ b/build/moz.configure/warnings.configure
@@ -52,7 +52,7 @@ check_and_add_gcc_warning('-Wclass-varargs')
check_and_add_gcc_warning('-Wloop-analysis')
# catches C++ version forward-compat issues
-check_and_add_gcc_warning('-Wc++1z-compat', cxx_compiler)
+# check_and_add_gcc_warning('-Wc++2a-compat', cxx_compiler)
# catches unintentional switch case fallthroughs
check_and_add_gcc_warning('-Wimplicit-fallthrough', cxx_compiler)
diff --git a/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp b/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
index eb6156f475..4b50adc059 100755
--- a/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
@@ -823,9 +823,9 @@ extern int pplex \
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylval = yylval_param;
@@ -878,7 +878,7 @@ YY_DECL
yy_match:
do
{
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
@@ -1336,9 +1336,9 @@ ECHO;
static int yy_get_next_buffer (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = yyg->yytext_ptr;
- register int number_to_move, i;
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = yyg->yytext_ptr;
+ int number_to_move, i;
int ret_val;
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
@@ -1470,15 +1470,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ yy_state_type yy_current_state;
+ char *yy_cp;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_current_state = yyg->yy_start;
for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
{
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
@@ -1503,11 +1503,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
{
- register int yy_is_jam;
+ int yy_is_jam;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
- register char *yy_cp = yyg->yy_c_buf_p;
+ char *yy_cp = yyg->yy_c_buf_p;
- register YY_CHAR yy_c = 1;
+ YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
diff --git a/gfx/angle/src/compiler/translator/glslang_lex.cpp b/gfx/angle/src/compiler/translator/glslang_lex.cpp
index 8ad7b1464d..4bda42eb9a 100755
--- a/gfx/angle/src/compiler/translator/glslang_lex.cpp
+++ b/gfx/angle/src/compiler/translator/glslang_lex.cpp
@@ -1286,9 +1286,9 @@ extern int yylex \
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylval = yylval_param;
@@ -1341,7 +1341,7 @@ YY_DECL
yy_match:
do
{
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
@@ -2237,9 +2237,9 @@ ECHO;
static int yy_get_next_buffer (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = yyg->yytext_ptr;
- register int number_to_move, i;
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = yyg->yytext_ptr;
+ int number_to_move, i;
int ret_val;
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
@@ -2371,15 +2371,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ yy_state_type yy_current_state;
+ char *yy_cp;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_current_state = yyg->yy_start;
for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
{
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
@@ -2404,11 +2404,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
{
- register int yy_is_jam;
+ int yy_is_jam;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
- register char *yy_cp = yyg->yy_c_buf_p;
+ char *yy_cp = yyg->yy_c_buf_p;
- register YY_CHAR yy_c = 1;
+ YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
index 951b612502..19a0b805d2 100644
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -5570,10 +5570,17 @@ class JS_PUBLIC_API(JSErrorNotes)
// Create a deep copy of notes.
js::UniquePtr<JSErrorNotes> copy(JSContext* cx);
- class iterator : public std::iterator<std::input_iterator_tag, js::UniquePtr<Note>>
- {
+ class iterator
+ {
+ private:
js::UniquePtr<Note>* note_;
- public:
+ public:
+ using iterator_category = std::input_iterator_tag;
+ using value_type = js::UniquePtr<Note>;
+ using difference_type = ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+
explicit iterator(js::UniquePtr<Note>* note = nullptr) : note_(note)
{}
diff --git a/js/src/vm/TypedArrayObject.cpp b/js/src/vm/TypedArrayObject.cpp
index de7ce028eb..e6144c0ac4 100644
--- a/js/src/vm/TypedArrayObject.cpp
+++ b/js/src/vm/TypedArrayObject.cpp
@@ -372,7 +372,7 @@ class TypedArrayObjectTemplate : public TypedArrayObject
public:
typedef NativeType ElementType;
- static constexpr Scalar::Type ArrayTypeID() { return TypeIDOfType<NativeType>::id; }
+ static const Scalar::Type ArrayTypeID() { return TypeIDOfType<NativeType>::id; }
static bool ArrayTypeIsUnsigned() { return TypeIsUnsigned<NativeType>(); }
static bool ArrayTypeIsFloatingPoint() { return TypeIsFloatingPoint<NativeType>(); }
diff --git a/media/webrtc/trunk/testing/gtest/include/gtest/gtest-printers.h b/media/webrtc/trunk/testing/gtest/include/gtest/gtest-printers.h
index 0639d9f586..686e85f106 100644
--- a/media/webrtc/trunk/testing/gtest/include/gtest/gtest-printers.h
+++ b/media/webrtc/trunk/testing/gtest/include/gtest/gtest-printers.h
@@ -1,4 +1,5 @@
// Copyright 2007, Google Inc.
+// Copyright 2023, Moonchild Productions
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -494,60 +495,60 @@ void PrintTupleTo(const T& t, ::std::ostream* os);
// regardless of whether tr1::tuple is implemented using the
// non-standard variadic template feature or not.
-inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
+inline void PrintTo(const ::std::tuple<>& t, ::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1>
-void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
+void PrintTo(const ::std::tuple<T1>& t, ::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2>
-void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
+void PrintTo(const ::std::tuple<T1, T2>& t, ::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
+void PrintTo(const ::std::tuple<T1, T2, T3>& t, ::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
+void PrintTo(const ::std::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
+void PrintTo(const ::std::tuple<T1, T2, T3, T4, T5>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
+void PrintTo(const ::std::tuple<T1, T2, T3, T4, T5, T6>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
+void PrintTo(const ::std::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
+void PrintTo(const ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
+void PrintTo(const ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
@@ -555,7 +556,7 @@ void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
void PrintTo(
- const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
+ const ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
@@ -774,8 +775,8 @@ struct TuplePrefixPrinter {
static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
*os << ", ";
- UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
- ::Print(::std::tr1::get<N - 1>(t), os);
+ UniversalPrinter<typename ::std::tuple_element<N - 1, Tuple>::type>
+ ::Print(::std::get<N - 1>(t), os);
}
// Tersely prints the first N fields of a tuple to a string vector,
@@ -784,7 +785,7 @@ struct TuplePrefixPrinter {
static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
::std::stringstream ss;
- UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
+ UniversalTersePrint(::std::get<N - 1>(t), &ss);
strings->push_back(ss.str());
}
};
@@ -807,14 +808,14 @@ template <>
struct TuplePrefixPrinter<1> {
template <typename Tuple>
static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
- UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
- Print(::std::tr1::get<0>(t), os);
+ UniversalPrinter<typename ::std::tuple_element<0, Tuple>::type>::
+ Print(::std::get<0>(t), os);
}
template <typename Tuple>
static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
::std::stringstream ss;
- UniversalTersePrint(::std::tr1::get<0>(t), &ss);
+ UniversalTersePrint(::std::get<0>(t), &ss);
strings->push_back(ss.str());
}
};
@@ -824,7 +825,7 @@ struct TuplePrefixPrinter<1> {
template <typename T>
void PrintTupleTo(const T& t, ::std::ostream* os) {
*os << "(";
- TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
+ TuplePrefixPrinter< ::std::tuple_size<T>::value>::
PrintPrefixTo(t, os);
*os << ")";
}
@@ -835,7 +836,7 @@ void PrintTupleTo(const T& t, ::std::ostream* os) {
template <typename Tuple>
Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
Strings result;
- TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
+ TuplePrefixPrinter< ::std::tuple_size<Tuple>::value>::
TersePrintPrefixToStrings(value, &result);
return result;
}
diff --git a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h
index e80548592c..fa8f6f0c3b 100644
--- a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h
+++ b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h
@@ -2,7 +2,8 @@
// pump.py gtest-param-util-generated.h.pump
// DO NOT EDIT BY HAND!!!
-// Copyright 2008 Google Inc.
+// Copyright 2008, Google Inc.
+// Copyright 2023, Moonchild Productions
// All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -3157,9 +3158,9 @@ class ValueArray50 {
//
template <typename T1, typename T2>
class CartesianProductGenerator2
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2> > {
public:
- typedef ::std::tr1::tuple<T1, T2> ParamType;
+ typedef ::std::tuple<T1, T2> ParamType;
CartesianProductGenerator2(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2)
@@ -3272,9 +3273,9 @@ class CartesianProductGenerator2
template <typename T1, typename T2, typename T3>
class CartesianProductGenerator3
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
+ typedef ::std::tuple<T1, T2, T3> ParamType;
CartesianProductGenerator3(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
@@ -3404,9 +3405,9 @@ class CartesianProductGenerator3
template <typename T1, typename T2, typename T3, typename T4>
class CartesianProductGenerator4
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4> ParamType;
CartesianProductGenerator4(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -3555,9 +3556,9 @@ class CartesianProductGenerator4
template <typename T1, typename T2, typename T3, typename T4, typename T5>
class CartesianProductGenerator5
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5> ParamType;
CartesianProductGenerator5(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -3723,10 +3724,10 @@ class CartesianProductGenerator5
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
class CartesianProductGenerator6
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5,
T6> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5, T6> ParamType;
CartesianProductGenerator6(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -3909,10 +3910,10 @@ class CartesianProductGenerator6
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
class CartesianProductGenerator7
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5, T6,
T7> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
CartesianProductGenerator7(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4112,10 +4113,10 @@ class CartesianProductGenerator7
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
class CartesianProductGenerator8
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5, T6,
T7, T8> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
CartesianProductGenerator8(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4334,10 +4335,10 @@ class CartesianProductGenerator8
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
class CartesianProductGenerator9
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5, T6,
T7, T8, T9> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
CartesianProductGenerator9(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4573,10 +4574,10 @@ class CartesianProductGenerator9
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
class CartesianProductGenerator10
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5, T6,
T7, T8, T9, T10> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
CartesianProductGenerator10(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4838,8 +4839,8 @@ class CartesianProductHolder2 {
CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
: g1_(g1), g2_(g2) {}
template <typename T1, typename T2>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
+ operator ParamGenerator< ::std::tuple<T1, T2> >() const {
+ return ParamGenerator< ::std::tuple<T1, T2> >(
new CartesianProductGenerator2<T1, T2>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_)));
@@ -4860,8 +4861,8 @@ CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
const Generator3& g3)
: g1_(g1), g2_(g2), g3_(g3) {}
template <typename T1, typename T2, typename T3>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
+ operator ParamGenerator< ::std::tuple<T1, T2, T3> >() const {
+ return ParamGenerator< ::std::tuple<T1, T2, T3> >(
new CartesianProductGenerator3<T1, T2, T3>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -4885,8 +4886,8 @@ CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
const Generator3& g3, const Generator4& g4)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
template <typename T1, typename T2, typename T3, typename T4>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4> >() const {
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4> >(
new CartesianProductGenerator4<T1, T2, T3, T4>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -4912,8 +4913,8 @@ CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
const Generator3& g3, const Generator4& g4, const Generator5& g5)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5> >() const {
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5> >(
new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -4943,8 +4944,8 @@ CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6> >() const {
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6> >(
new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -4976,9 +4977,9 @@ CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6,
T7> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7> >(
new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -5014,9 +5015,9 @@ CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
g8_(g8) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7,
T8> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -5055,9 +5056,9 @@ CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
g9_(g9) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
T9> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
T9> >(
new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
static_cast<ParamGenerator<T1> >(g1_),
@@ -5099,9 +5100,9 @@ CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
g9_(g9), g10_(g10) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
T9, T10> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
T9, T10> >(
new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
T10>(
diff --git a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
index 009206fd31..864fbee16b 100644
--- a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
+++ b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
@@ -1,7 +1,8 @@
$$ -*- mode: c++; -*-
$var n = 50 $$ Maximum length of Values arguments we want to support.
$var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
-// Copyright 2008 Google Inc.
+// Copyright 2008, Google Inc.
+// Copyright 2023, Moonchild Productions
// All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -128,9 +129,9 @@ $range k 2..i
template <$for j, [[typename T$j]]>
class CartesianProductGenerator$i
- : public ParamGeneratorInterface< ::std::tr1::tuple<$for j, [[T$j]]> > {
+ : public ParamGeneratorInterface< ::std::tuple<$for j, [[T$j]]> > {
public:
- typedef ::std::tr1::tuple<$for j, [[T$j]]> ParamType;
+ typedef ::std::tuple<$for j, [[T$j]]> ParamType;
CartesianProductGenerator$i($for j, [[const ParamGenerator<T$j>& g$j]])
: $for j, [[g$(j)_(g$j)]] {}
@@ -269,8 +270,8 @@ class CartesianProductHolder$i {
CartesianProductHolder$i($for j, [[const Generator$j& g$j]])
: $for j, [[g$(j)_(g$j)]] {}
template <$for j, [[typename T$j]]>
- operator ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >() const {
- return ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >(
+ operator ParamGenerator< ::std::tuple<$for j, [[T$j]]> >() const {
+ return ParamGenerator< ::std::tuple<$for j, [[T$j]]> >(
new CartesianProductGenerator$i<$for j, [[T$j]]>(
$for j,[[
diff --git a/memory/mozalloc/mozalloc.h b/memory/mozalloc/mozalloc.h
index de8c549b31..8c224472c4 100644
--- a/memory/mozalloc/mozalloc.h
+++ b/memory/mozalloc/mozalloc.h
@@ -152,14 +152,11 @@ MFBT_API void* moz_xvalloc(size_t size)
#if defined(_MSC_VER)
/*
- * Suppress build warning spam (bug 578546).
+ * Suppress build warning spam (issue #2281).
*/
-#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-#define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
+#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS noexcept(true)
+#define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS noexcept(false)
#elif __cplusplus >= 201103
-/*
- * C++11 has deprecated exception-specifications in favour of |noexcept|.
- */
#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS noexcept(true)
#define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS noexcept(false)
#else
diff --git a/memory/mozalloc/throw_gcc.h b/memory/mozalloc/throw_gcc.h
index c51794573e..3c61939eba 100644
--- a/memory/mozalloc/throw_gcc.h
+++ b/memory/mozalloc/throw_gcc.h
@@ -6,6 +6,9 @@
#ifndef mozilla_throw_gcc_h
#define mozilla_throw_gcc_h
+// Wrapping shouldn't be needed on libcpp 14+
+#if !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 14000
+
#include "mozilla/Attributes.h"
#include <stdio.h> // snprintf
@@ -140,4 +143,6 @@ __throw_system_error(int err)
#undef MOZ_THROW_NORETURN
+#endif // !_LIBCPP_VERSION || _LIBCPP_VERSION < 14000
+
#endif // mozilla_throw_gcc_h
diff --git a/mfbt/Compression.cpp b/mfbt/Compression.cpp
index 6147d0d611..8dc2ec3d86 100644
--- a/mfbt/Compression.cpp
+++ b/mfbt/Compression.cpp
@@ -11,17 +11,9 @@
// corecrt_memory.h.
#include <string>
-using namespace mozilla::Compression;
-
-namespace {
-
-extern "C" {
-
-#include "lz4.c"
+#include "lz4.h"
-}
-
-}/* anonymous namespace */
+using namespace mozilla::Compression;
/* Our wrappers */
diff --git a/mfbt/Span.h b/mfbt/Span.h
index e71e068c60..fe679aa8bf 100644
--- a/mfbt/Span.h
+++ b/mfbt/Span.h
@@ -810,6 +810,15 @@ private:
storage_type<span_details::extent_type<Extent>> storage_;
};
+template <typename T, size_t Extent>
+Span(T (&aArr)[Extent]) -> Span<T, Extent>;
+
+template <class Container>
+Span(Container&) -> Span<typename Container::value_type>;
+
+template <class Container>
+Span(const Container&) -> Span<const typename Container::value_type>;
+
// [Span.comparison], Span comparison operators
template<class ElementType, size_t FirstExtent, size_t SecondExtent>
inline bool
diff --git a/mfbt/moz.build b/mfbt/moz.build
index 54b13f21b9..e4b294292d 100644
--- a/mfbt/moz.build
+++ b/mfbt/moz.build
@@ -124,20 +124,11 @@ SOURCES += mfbt_nonunified_src_cppsrcs
DISABLE_STL_WRAPPING = True
-# Suppress warnings in third-party LZ4 code.
-# TODO: Remove these suppressions after bug 993267 is fixed.
-
-if CONFIG['GNU_CXX']:
- SOURCES['/mfbt/Compression.cpp'].flags += ['-Wno-unused-function']
- CXXFLAGS += ['-Wno-error=shadow']
-
if CONFIG['CLANG_CXX']:
# Suppress warnings from third-party V8 Decimal code.
SOURCES['/mfbt/decimal/Decimal.cpp'].flags += ['-Wno-implicit-fallthrough']
-if CONFIG['_MSC_VER']:
- # Error 4804 is "'>' : unsafe use of type 'bool' in operation"
- SOURCES['/mfbt/Compression.cpp'].flags += ['-wd4804']
-
if CONFIG['MOZ_NEEDS_LIBATOMIC']:
OS_LIBS += ['atomic']
+
+DEFINES['LZ4LIB_VISIBILITY'] = ''
diff --git a/mfbt/objs.mozbuild b/mfbt/objs.mozbuild
index 8aed3d179f..e8fd522d79 100644
--- a/mfbt/objs.mozbuild
+++ b/mfbt/objs.mozbuild
@@ -28,9 +28,11 @@ mfbt_src_cppsrcs = [
# Compression.cpp cannot be built in unified mode because it pulls in Windows system headers.
# Decimal.cpp doesn't build in unified mode with gcc.
+# We build lz4 in C mode
mfbt_nonunified_src_lcppsrcs = [
'Compression.cpp',
'decimal/Decimal.cpp',
+ 'lz4.c',
]
mfbt_nonunified_src_cppsrcs = [
diff --git a/toolkit/components/protobuf/src/google/protobuf/repeated_field.h b/toolkit/components/protobuf/src/google/protobuf/repeated_field.h
index 50051831d6..29fe823360 100644
--- a/toolkit/components/protobuf/src/google/protobuf/repeated_field.h
+++ b/toolkit/components/protobuf/src/google/protobuf/repeated_field.h
@@ -1250,23 +1250,14 @@ namespace internal {
// This code based on net/proto/proto-array-internal.h by Jeffrey Yasskin
// (jyasskin@google.com).
template<typename Element>
-class RepeatedPtrIterator
- : public std::iterator<
- std::random_access_iterator_tag, Element> {
+class RepeatedPtrIterator {
public:
typedef RepeatedPtrIterator<Element> iterator;
- typedef std::iterator<
- std::random_access_iterator_tag, Element> superclass;
-
- // Shadow the value_type in std::iterator<> because const_iterator::value_type
- // needs to be T, not const T.
- typedef typename remove_const<Element>::type value_type;
-
- // Let the compiler know that these are type names, so we don't have to
- // write "typename" in front of them everywhere.
- typedef typename superclass::reference reference;
- typedef typename superclass::pointer pointer;
- typedef typename superclass::difference_type difference_type;
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef Element value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef Element* pointer;
+ typedef Element& reference;
RepeatedPtrIterator() : it_(NULL) {}
explicit RepeatedPtrIterator(void* const* it) : it_(it) {}
@@ -1346,22 +1337,14 @@ class RepeatedPtrIterator
// referenced by the iterator. It should either be "void *" for a mutable
// iterator, or "const void *" for a constant iterator.
template<typename Element, typename VoidPtr>
-class RepeatedPtrOverPtrsIterator
- : public std::iterator<std::random_access_iterator_tag, Element*> {
+class RepeatedPtrOverPtrsIterator {
public:
typedef RepeatedPtrOverPtrsIterator<Element, VoidPtr> iterator;
- typedef std::iterator<
- std::random_access_iterator_tag, Element*> superclass;
-
- // Shadow the value_type in std::iterator<> because const_iterator::value_type
- // needs to be T, not const T.
- typedef typename remove_const<Element*>::type value_type;
-
- // Let the compiler know that these are type names, so we don't have to
- // write "typename" in front of them everywhere.
- typedef typename superclass::reference reference;
- typedef typename superclass::pointer pointer;
- typedef typename superclass::difference_type difference_type;
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef Element value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef Element* pointer;
+ typedef Element& reference;
RepeatedPtrOverPtrsIterator() : it_(NULL) {}
explicit RepeatedPtrOverPtrsIterator(VoidPtr* it) : it_(it) {}
diff --git a/xpcom/glue/nsTArray.h b/xpcom/glue/nsTArray.h
index 03913a3765..47635de318 100644
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -2466,6 +2466,12 @@ MakeSpan(const nsTArray_Impl<ElementType, TArrayAlloc>& aTArray)
return aTArray;
}
+template <typename E, class Alloc>
+Span(nsTArray_Impl<E, Alloc>&) -> Span<E>;
+
+template <typename E, class Alloc>
+Span(const nsTArray_Impl<E, Alloc>&) -> Span<const E>;
+
} // namespace mozilla
// Assert that AutoTArray doesn't have any extra padding inside.