summaryrefslogtreecommitdiff
path: root/absl/types/internal
diff options
context:
space:
mode:
Diffstat (limited to 'absl/types/internal')
-rw-r--r--absl/types/internal/conformance_profile.h2
-rw-r--r--absl/types/internal/optional.h8
-rw-r--r--absl/types/internal/variant.h6
3 files changed, 13 insertions, 3 deletions
diff --git a/absl/types/internal/conformance_profile.h b/absl/types/internal/conformance_profile.h
index cf64ff4f..37b017db 100644
--- a/absl/types/internal/conformance_profile.h
+++ b/absl/types/internal/conformance_profile.h
@@ -719,6 +719,7 @@ struct SyntacticConformanceProfileOf {
type##_support); \
ABSL_INTERNAL_CONFORMANCE_TESTING_DATA_MEMBER_DEF_IMPL(bool, is_##type)
+#ifdef ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
ABSL_INTERNAL_CONFORMANCE_TESTING_DATA_MEMBER_DEF(default_constructible);
ABSL_INTERNAL_CONFORMANCE_TESTING_DATA_MEMBER_DEF(move_constructible);
ABSL_INTERNAL_CONFORMANCE_TESTING_DATA_MEMBER_DEF(copy_constructible);
@@ -733,6 +734,7 @@ ABSL_INTERNAL_CONFORMANCE_TESTING_DATA_MEMBER_DEF(greater_equal_comparable);
ABSL_INTERNAL_CONFORMANCE_TESTING_DATA_MEMBER_DEF(greater_than_comparable);
ABSL_INTERNAL_CONFORMANCE_TESTING_DATA_MEMBER_DEF(swappable);
ABSL_INTERNAL_CONFORMANCE_TESTING_DATA_MEMBER_DEF(hashable);
+#endif
#undef ABSL_INTERNAL_CONFORMANCE_TESTING_DATA_MEMBER_DEF
#undef ABSL_INTERNAL_CONFORMANCE_TESTING_DATA_MEMBER_DEF_IMPL
diff --git a/absl/types/internal/optional.h b/absl/types/internal/optional.h
index 92932b60..6ed0c669 100644
--- a/absl/types/internal/optional.h
+++ b/absl/types/internal/optional.h
@@ -91,7 +91,15 @@ class optional_data_dtor_base {
void destruct() noexcept {
if (engaged_) {
+ // `data_` must be initialized if `engaged_` is true.
+#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
data_.~T();
+#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
+#pragma GCC diagnostic pop
+#endif
engaged_ = false;
}
}
diff --git a/absl/types/internal/variant.h b/absl/types/internal/variant.h
index 772008c7..7c402ece 100644
--- a/absl/types/internal/variant.h
+++ b/absl/types/internal/variant.h
@@ -16,8 +16,8 @@
// separate file to avoid cluttering the top of the API header with
// implementation details.
-#ifndef ABSL_TYPES_variant_internal_H_
-#define ABSL_TYPES_variant_internal_H_
+#ifndef ABSL_TYPES_VARIANT_INTERNAL_H_
+#define ABSL_TYPES_VARIANT_INTERNAL_H_
#include <cassert>
#include <cstddef>
@@ -1643,4 +1643,4 @@ ABSL_NAMESPACE_END
} // namespace absl
#endif // !defined(ABSL_USES_STD_VARIANT)
-#endif // ABSL_TYPES_variant_internal_H_
+#endif // ABSL_TYPES_VARIANT_INTERNAL_H_