diff options
author | Marek Polacek <polacek@redhat.com> | 2024-08-01 10:35:38 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2024-08-02 14:42:17 -0400 |
commit | 5ebfaf2d4994c124ce81aa0abd7eaa1529644749 (patch) | |
tree | f4ac1194f8e27d665c118531d16f94589dd91556 /gcc/c-family/c.opt | |
parent | 5b4476a165565cb20729c0a97a3f43b060595209 (diff) | |
download | gcc-5ebfaf2d4994c124ce81aa0abd7eaa1529644749.zip gcc-5ebfaf2d4994c124ce81aa0abd7eaa1529644749.tar.gz gcc-5ebfaf2d4994c124ce81aa0abd7eaa1529644749.tar.bz2 |
c++: Move -Wdangling-reference to -Wextra
Despite a number of mitigations (don't warn for std::span-like classes,
lambdas, adding [[gnu::no_dangling]], etc.), the warning still seems to
cause some grief. Let's move the warning to -Wextra, then.
gcc/c-family/ChangeLog:
* c.opt (Wdangling-reference): Move from -Wall to -Wextra.
gcc/ChangeLog:
* doc/invoke.texi: Document that -Wdangling-reference is
enabled by -Wextra.
Diffstat (limited to 'gcc/c-family/c.opt')
-rw-r--r-- | gcc/c-family/c.opt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index a52682d..979f17a 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -604,7 +604,7 @@ C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_dangling_pointer) Warn Warn for uses of pointers to auto variables whose lifetime has ended. Wdangling-reference -C++ ObjC++ Var(warn_dangling_reference) Warning LangEnabledBy(C++ ObjC++, Wall) +C++ ObjC++ Var(warn_dangling_reference) Warning LangEnabledBy(C++ ObjC++, Wextra) Warn when a reference is bound to a temporary whose lifetime has ended. Wdate-time |