diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 7b544d2534d469..bc3c548da8b96c 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3465,7 +3465,7 @@ defm diagnostics_show_line_numbers : BoolFOption<"diagnostics-show-line-numbers" PosFlag>; def fno_realloc_lhs : Flag<["-"], "fno-realloc-lhs">, Group, HelpText<"An allocatable left-hand side of an intrinsic assignment is assumed to be allocated and match the shape/type of the right-hand side">, - Visibility<[FlangOption, FC1Option]>; + Visibility<[ClangOption, CLOption, FlangOption, FC1Option]>; def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group, HelpText<"Disable the use of stack protectors">; def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group, @@ -4300,7 +4300,7 @@ defm stack_size_section : BoolFOption<"stack-size-section", "Emit section containing metadata on function stack sizes">, NegFlag>; def frealloc_lhs : Flag<["-"], "frealloc-lhs">, Group, - Visibility<[FlangOption, FC1Option]>, + Visibility<[ClangOption, CLOption, FlangOption, FC1Option]>, HelpText<"If an allocatable left-hand side of an intrinsic assignment is unallocated or its shape/type does not match the right-hand side, then it is automatically (re)allocated">; def fstack_usage : Flag<["-"], "fstack-usage">, Group, HelpText<"Emit .su file containing information on function stack sizes">; diff --git a/clang/test/Driver/frealloc-lhs.cpp b/clang/test/Driver/frealloc-lhs.cpp new file mode 100644 index 00000000000000..792247deaaa2c1 --- /dev/null +++ b/clang/test/Driver/frealloc-lhs.cpp @@ -0,0 +1,7 @@ +// RUN: %clang -Wunused-command-line-argument -frealloc-lhs -### %s 2> %t +// RUN: FileCheck < %t %s --check-prefix=REALLOCLHS +// RUN: %clang -Wunused-command-line-argument -fno-realloc-lhs -### %s 2> %t +// RUN: FileCheck < %t %s --check-prefix=NOREALLOCLHS + +// CHECK: argument unused during compilation: '-frealloc-lhs' +// CHECK: argument unused during compilation: '-fno-realloc-lhs'