Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -2678,6 +2678,9 @@ def fvisibility_inlines_hidden : Flag<["-"], "fvisibility-inlines-hidden">, Group, HelpText<"Give inline C++ member functions hidden visibility by default">, Flags<[CC1Option]>, MarshallingInfoFlag>; +def fno_visibility_inlines_hidden : Flag<["-"], "fno-visibility-inlines-hidden">, Group, + HelpText<"Do not give inline C++ member functions hidden visibility by default">, + Flags<[CC1Option]>; defm visibility_inlines_hidden_static_local_var : BoolFOption<"visibility-inlines-hidden-static-local-var", LangOpts<"VisibilityInlinesHiddenStaticLocalVar">, DefaultFalse, PosFlaggetAsString(Args) << TripleStr; } - Args.AddLastArg(CmdArgs, options::OPT_fvisibility_inlines_hidden); + Args.AddLastArg(CmdArgs, options::OPT_fvisibility_inlines_hidden, + options::OPT_fno_visibility_inlines_hidden); Args.AddLastArg(CmdArgs, options::OPT_fvisibility_inlines_hidden_static_local_var, options::OPT_fno_visibility_inlines_hidden_static_local_var); Args.AddLastArg(CmdArgs, options::OPT_fvisibility_global_new_delete_hidden); Index: clang/test/Driver/visibility-inlines-hidden.cpp =================================================================== --- /dev/null +++ clang/test/Driver/visibility-inlines-hidden.cpp @@ -0,0 +1,19 @@ +// RUN: %clang -### -S -fvisibility-inlines-hidden %s 2> %t.log +// RUN: FileCheck -check-prefix=CHECK-1 %s < %t.log +// CHECK-1: "-fvisibility-inlines-hidden" +// CHECK-1-NOT: "-fno-visibility-inlines-hidden" + +// RUN: %clang -### -S -fno-visibility-inlines-hidden %s 2> %t.log +// RUN: FileCheck -check-prefix=CHECK-2 %s < %t.log +// CHECK-2: "-fno-visibility-inlines-hidden" +// CHECK-2-NOT: "-fvisibility-inlines-hidden" + +// RUN: %clang -### -S -fvisibility-inlines-hidden -fno-visibility-inlines-hidden %s 2> %t.log +// RUN: FileCheck -check-prefix=CHECK-3 %s < %t.log +// CHECK-3: "-fno-visibility-inlines-hidden" +// CHECK-3-NOT: "-fvisibility-inlines-hidden" + +// RUN: %clang -### -S -fno-visibility-inlines-hidden -fvisibility-inlines-hidden %s 2> %t.log +// RUN: FileCheck -check-prefix=CHECK-4 %s < %t.log +// CHECK-4: "-fvisibility-inlines-hidden" +// CHECK-4-NOT: "-fno-visibility-inlines-hidden"