diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 1cf62ab466134..618815db28434 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3397,7 +3397,7 @@ def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group, def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group, Visibility<[ClangOption, FlangOption]>; defm operator_names : BoolFOption<"operator-names", - LangOpts<"CXXOperatorNames">, Default, + LangOpts<"CXXOperatorNames">, Default, NegFlag, PosFlag>; diff --git a/clang/test/SemaHLSL/use-cxx-alt-operator-names.hlsl b/clang/test/SemaHLSL/use-cxx-alt-operator-names.hlsl new file mode 100644 index 0000000000000..e93be2bbf4e69 --- /dev/null +++ b/clang/test/SemaHLSL/use-cxx-alt-operator-names.hlsl @@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library %s -ast-dump | FileCheck %s + +// CHECK: -FunctionDecl {{.*}} and 'void ()' +void and() {} + +// CHECK: -FunctionDecl {{.*}} and_eq 'void ()' +void and_eq() {} + +// CHECK: -FunctionDecl {{.*}} bitand 'void ()' +void bitand() {} + +// CHECK: -FunctionDecl {{.*}} bitor 'void ()' +void bitor() {} + +// CHECK: -FunctionDecl {{.*}} compl 'void ()' +void compl() {} + +// CHECK: -FunctionDecl {{.*}} not 'void ()' +void not() {} + +// CHECK: -FunctionDecl {{.*}} not_eq 'void ()' +void not_eq() {} + +// CHECK: -FunctionDecl {{.*}} or 'void ()' +void or() {} + +// CHECK: -FunctionDecl {{.*}} or_eq 'void ()' +void or_eq() {} + +// CHECK: -FunctionDecl {{.*}} xor 'void ()' +void xor() {} + +// CHECK: -FunctionDecl {{.*}} xor_eq 'void ()' +void xor_eq() {}