Skip to content

Commit 9aefcee

Browse files
committed
Move -Wno-error-dangling-reference to common.h GCC pragma
Only GCC 13+ recognizes it, seems simpler to add it to `common.h`'s opening list of known-spurious warnings we disable to build cppfront cleanly
1 parent 9585ecc commit 9aefcee

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/build-cppfront.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
runs-on: ${{ matrix.runs-on }}
4343
env:
4444
CXX: ${{ matrix.compiler }}
45-
CXXFLAGS: -std=${{ matrix.cxx-std }} -Wall -Wextra -Wold-style-cast -Wunused-parameter -Wno-error=dangling-reference -Wpedantic -Werror -pthread
45+
CXXFLAGS: -std=${{ matrix.cxx-std }} -Wall -Wextra -Wold-style-cast -Wunused-parameter -Wpedantic -Werror -pthread
4646
steps:
4747
- uses: actions/checkout@v3
4848
- name: Install compiler

source/common.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@
1111
// THE SOFTWARE.
1212

1313

14+
// We want cppfront to build cleanly at very high warning levels, with warnings
15+
// as errors -- so disable a handful that fire incorrectly due to compiler bugs
1416
#ifdef _MSC_VER
15-
#pragma warning(disable: 4456)
17+
#pragma warning(disable: 4456)
18+
#endif
19+
#if defined(__GNUC__) && __GNUC__ >= 13 && !defined(__clang_major__)
20+
#pragma GCC diagnostic ignored "-Wno-dangling-reference"
1621
#endif
1722

1823
#include "cpp2util.h"

0 commit comments

Comments
 (0)