diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 1b9b3f2c6600a..049c6cf4cef95 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -5978,7 +5978,9 @@ def _no_line_commands : Flag<["--"], "no-line-commands">, Alias
;
def _no_standard_includes : Flag<["--"], "no-standard-includes">, Alias;
def _no_standard_libraries : Flag<["--"], "no-standard-libraries">, Alias;
def _no_undefined : Flag<["--"], "no-undefined">, Flags<[LinkerInput]>;
-def _no_warnings : Flag<["--"], "no-warnings">, Alias;
+def _no_warnings : Flag<["--"], "no-warnings">,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
+ Alias;
def _optimize_EQ : Joined<["--"], "optimize=">, Alias;
def _optimize : Flag<["--"], "optimize">, Alias;
def _output_class_directory_EQ : Joined<["--"], "output-class-directory=">, Alias;
diff --git a/flang/test/Driver/w-option.f90 b/flang/test/Driver/w-option.f90
index e34cddaab373a..b6aa44a06ab72 100644
--- a/flang/test/Driver/w-option.f90
+++ b/flang/test/Driver/w-option.f90
@@ -4,6 +4,9 @@
! Test that the warnings are not generated with `-w` option.
! RUN: %flang -c -w %s 2>&1 | FileCheck --allow-empty %s -check-prefix=WARNING
+! Test that the warnings are not generated with `--no-warnings` option.
+! RUN: %flang -c --no-warnings %s 2>&1 | FileCheck --allow-empty %s -check-prefix=WARNING
+
! Test that warnings are portability messages are generated.
! RUN: %flang -c -pedantic %s 2>&1 | FileCheck %s -check-prefixes=DEFAULT,PORTABILITY