diff options
author | Patrick Palka <ppalka@redhat.com> | 2024-03-04 21:32:44 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2024-03-04 21:32:44 -0500 |
commit | 08edf85f747b9ac1850f9688c8a1bc7c2bf6b4e5 (patch) | |
tree | 0ddd922015c6047ae47ebf182eeb178911b47720 /gcc/c-family | |
parent | 264e3ad419cf71b10e7951a23750ac3507e21df9 (diff) | |
download | gcc-08edf85f747b9ac1850f9688c8a1bc7c2bf6b4e5.zip gcc-08edf85f747b9ac1850f9688c8a1bc7c2bf6b4e5.tar.gz gcc-08edf85f747b9ac1850f9688c8a1bc7c2bf6b4e5.tar.bz2 |
c++/modules: relax diagnostic about GMF contents
Issuing a hard error when the GMF doesn't consist only of preprocessing
directives happens to be inconvenient for automated testcase reduction
via cvise. This patch relaxes this diagnostic into a pedwarn that can
be disabled with -Wno-global-module.
gcc/c-family/ChangeLog:
* c.opt (Wglobal-module): New warning.
gcc/cp/ChangeLog:
* parser.cc (cp_parser_translation_unit): Relax GMF contents
error into a pedwarn.
gcc/ChangeLog:
* doc/invoke.texi (-Wno-global-module): Document.
gcc/testsuite/ChangeLog:
* g++.dg/modules/friend-6_a.C: Pass -Wno-global-module instead
of -Wno-pedantic. Remove now unnecessary preprocessing
directives from GMF.
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/c.opt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index b7a4a1a..56cccf2 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -802,6 +802,10 @@ Wframe-address C ObjC C++ ObjC++ Var(warn_frame_address) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) Warn when __builtin_frame_address or __builtin_return_address is used unsafely. +Wglobal-module +C++ ObjC++ Var(warn_global_module) Warning Init(1) +Warn about the global module fragment not containing only preprocessing directives. + Wif-not-aligned C ObjC C++ ObjC++ Var(warn_if_not_aligned) Init(1) Warning Warn when the field in a struct is not aligned. |