[Chapel Merge] 20805 Make negation of any uint be an error

Branch: refs/heads/main
Revision: 2286c22ff87bb4a19e3af17ec233d38d7d480a94
Author: Michael Ferguson
Link: [Merge pull request] # 20805 from mppf:unary-minus-uint-err Make negation of any uint be an error by mppf · Pull Request #20805 · chapel-lang/chapel · GitHub
Log Message:

[Merge pull request] # 20805 from mppf:unary-minus-uint-err
Try making unary - on a uint an error
Resolves #20629 This PR adjusts the overloads for unary - to issue an error when negating a uint value of any width (and for param cases to be an error as well, for consistency). Before this PR: * negating a uint resulted in an error * negating a uint(32) resulted in an int(64) * negating a param uint would result in a param int if it fit and an error if not. After this PR, all of the above result in a compilation error. This approach was proposed in [Design] Make unary negation of unsigned integers an error? and the related issue #20807 where it received a lot of support. This PR adjusts the domain methods expand exterior interior and translate to accept integral arguments similarly to the range functions with the same name. Reviewed by @bradcray - thanks! - full local testing

Compare: Comparing 3a8adb51ceb2f92ac7b1dfd508f2d816ded5c281...2286c22ff87bb4a19e3af17ec233d38d7d480a94 · chapel-lang/chapel · GitHub
Diff: https://github.com/chapel-lang/chapel/pull/20805.diff
FilesChanged: Make negation of any uint be an error by mppf · Pull Request #20805 · chapel-lang/chapel · GitHub

Modified Files:
compiler/llvm/clangUtil.cpp,frontend/include/chpl/resolution/copy-elision.h,frontend/lib/framework/Context.cpp,frontend/lib/resolution/VarScopeVisitor.cpp,frontend/lib/resolution/VarScopeVisitor.h,frontend/lib/resolution/call-init-deinit.cpp,frontend/lib/resolution/copy-elision.cpp,frontend/lib/resolution/split-init.cpp,frontend/test/resolution/CMakeLists.txt,frontend/test/resolution/testCopyElision.cpp,frontend/test/resolution/testSplitInit.cpp,modules/internal/ChapelBase.chpl,modules/internal/ChapelDomain.chpl,modules/internal/ChapelRange.chpl,test/domains/sungeun/rect/expand.chpl,test/domains/sungeun/rect/expand.good,test/domains/sungeun/rect/exterior.chpl,test/domains/sungeun/rect/exterior.good,test/domains/sungeun/rect/interior.chpl,test/domains/sungeun/rect/interior.good,test/domains/sungeun/rect/translate.chpl,test/domains/sungeun/rect/translate.good,test/domains/sungeun/rect/translate_illegal.good,test/domains/sungeun/rect/translate_illegal.prediff,test/extern/ExternBlockClangError.chpl,test/extern/ExternBlockClangError.compopts,test/extern/ExternBlockClangError.good,test/functions/diten/unary_uint64_param_minus.good,test/gpu/native/studies/shoc/triadchpl.chpl,test/trivial/deitz/integers/negate_uint32.good,test/visibility/except/operatorsExceptions/exceptNegation.good

Removed Files: