Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -3397,7 +3397,7 @@ def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group<f_Group>,
def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group<f_Group>,
Visibility<[ClangOption, FlangOption]>;
defm operator_names : BoolFOption<"operator-names",
LangOpts<"CXXOperatorNames">, Default<cplusplus.KeyPath>,
LangOpts<"CXXOperatorNames">, Default<!strconcat(cplusplus.KeyPath, " && !",hlsl.KeyPath)>,
NegFlag<SetFalse, [], [ClangOption, CC1Option],
"Do not treat C++ operator name keywords as synonyms for operators">,
PosFlag<SetTrue>>;
Expand Down
34 changes: 34 additions & 0 deletions clang/test/SemaHLSL/use-cxx-alt-operator-names.hlsl
Original file line number Diff line number Diff line change
@@ -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() {}