From 68d7d1a4d964396c77b02661ca81696c885e8545 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 14 May 2022 14:12:09 -0400 Subject: [PATCH] Fix some GCC-12 warnings. --- include/deal.II/base/config.h.in | 1 + source/fe/fe_rt_bubbles.cc | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index aff1915bcb..4ab74a0df4 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -463,6 +463,7 @@ _Pragma("GCC diagnostic ignored \"-Wunused-function\"") \ _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \ _Pragma("GCC diagnostic ignored \"-Wunused-private-field\"") \ _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \ +_Pragma("GCC diagnostic ignored \"-Wuse-after-free\"") \ _Pragma("GCC diagnostic warning \"-Wpragmas\"") /*!*/ # define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS \ diff --git a/source/fe/fe_rt_bubbles.cc b/source/fe/fe_rt_bubbles.cc index bd3b3ce960..14d9a36be8 100644 --- a/source/fe/fe_rt_bubbles.cc +++ b/source/fe/fe_rt_bubbles.cc @@ -208,8 +208,11 @@ FE_RT_Bubbles::initialize_support_points(const unsigned int deg) // one for each direction QGaussLobatto<1> high(deg + 1); std::vector> pts = high.get_points(); - pts.erase(pts.begin()); - pts.erase(pts.end() - 1); + if (pts.size() > 2) + { + pts.erase(pts.begin()); + pts.erase(pts.end() - 1); + } std::vector wts(pts.size(), 1); Quadrature<1> low(pts, wts); -- 2.39.5