-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Clang][Sema] Fix -Whigher-precision-for-complex-division #131477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Maetveis
merged 4 commits into
llvm:main
from
Maetveis:fix-whigher-precision-for-complex-division
Apr 16, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d3da72b
[Clang][Sema] Fix -Whigher-precision-for-complex-division
Maetveis bc17e83
Merge remote-tracking branch 'origin/main' into fix-whigher-precision…
Maetveis a891bfa
Reword release notes
Maetveis 63ae8f7
Add periods to end of bullet points in release notes
Maetveis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| // RUN: %clang_cc1 %s -complex-range=promoted -fsyntax-only -triple x86_64-unknown-linux -verify=no-diag \ | ||
| // RUN: -DDIV_CC -DDIV_RC -DDIVASSIGN -DDIVMIXEDFD -DDIVMIXEDFD2 -DDIVMIXEDID -DDIVASSIGN_MIXEDFD | ||
|
|
||
| // RUN: %clang_cc1 %s -complex-range=promoted -fsyntax-only -triple x86_64-unknown-windows -verify=no-diag | ||
| // RUN: %clang_cc1 %s -complex-range=promoted -fsyntax-only -triple x86_64-unknown-windows -verify -DDIV_CC | ||
| // RUN: %clang_cc1 %s -complex-range=promoted -fsyntax-only -triple x86_64-unknown-windows -verify -DDIV_RC | ||
| // RUN: %clang_cc1 %s -complex-range=promoted -fsyntax-only -triple x86_64-unknown-windows -verify -DDIVASSIGN | ||
| // RUN: %clang_cc1 %s -complex-range=promoted -fsyntax-only -triple x86_64-unknown-windows -verify -DDIVMIXEDFD | ||
| // RUN: %clang_cc1 %s -complex-range=promoted -fsyntax-only -triple x86_64-unknown-windows -verify -DDIVMIXEDFD2 | ||
| // RUN: %clang_cc1 %s -complex-range=promoted -fsyntax-only -triple x86_64-unknown-windows -verify -DDIVMIXEDID | ||
| // RUN: %clang_cc1 %s -complex-range=promoted -fsyntax-only -triple x86_64-unknown-windows -verify -DDIVASSIGN_MIXEDFD | ||
|
|
||
| _Complex double div_ccf(_Complex float a, _Complex float b) { | ||
| return a / b; | ||
| } | ||
|
|
||
| _Complex double div_cr(_Complex double a, double b) { | ||
| return a / b; | ||
| } | ||
|
|
||
| _Complex double div_cr_mixed1(_Complex double a, float b) { | ||
| return a / b; | ||
| } | ||
|
|
||
| _Complex double div_cr_mixed2(_Complex float a, double b) { | ||
| return a / b; | ||
| } | ||
|
|
||
| _Complex double div_rr(double a, double b) { | ||
| return a / b; | ||
| } | ||
|
|
||
| _Complex int div_ii(_Complex int a, _Complex int b) { | ||
| return a / b; | ||
| } | ||
|
|
||
| struct UserT { | ||
| friend UserT operator/(UserT, _Complex double); | ||
| friend UserT operator/(_Complex double, UserT); | ||
| }; | ||
|
|
||
| UserT div_uc(UserT a, _Complex double b) { | ||
| return a / b; | ||
| } | ||
|
|
||
| UserT div_cu(_Complex double a, UserT b) { | ||
| return a / b; | ||
| } | ||
|
|
||
| #ifdef DIV_CC | ||
| _Complex double div_cc(_Complex double a, const _Complex double b) { | ||
| return a / b; // #1 | ||
| } | ||
| #endif // DIV_CC | ||
|
|
||
| #ifdef DIV_RC | ||
| _Complex double div_rc(double a, _Complex float b) { | ||
| return a / b; // #1 | ||
| } | ||
| #endif // DIV_RC | ||
|
|
||
| #ifdef DIVASSIGN | ||
| _Complex double divassign(_Complex double a, _Complex double b) { | ||
| return a /= b; // #1 | ||
| } | ||
| #endif // DIVASSIGN | ||
|
|
||
| #ifdef DIVMIXEDFD | ||
| _Complex double divmixedfd(_Complex float a, _Complex double b) { | ||
| return a / b; // #1 | ||
| } | ||
| #endif // DIVMIXEDFD | ||
|
|
||
| #ifdef DIVMIXEDFD2 | ||
| _Complex double divmixedfd2(_Complex double a, _Complex float b) { | ||
| return a / b; // #1 | ||
| } | ||
| #endif // DIVMIXEDFD2 | ||
|
|
||
| #ifdef DIVMIXEDID | ||
| _Complex double divmixedid(_Complex int a, _Complex double b) { | ||
| return a / b; // #1 | ||
| } | ||
| #endif // DIVMIXEDID | ||
|
|
||
| #ifdef DIVASSIGN_MIXEDFD | ||
| _Complex double divassign_mixedfd(_Complex float a, _Complex double b) { | ||
| return a /= b; // #1 | ||
| } | ||
| #endif // DIVMIXEDFD | ||
|
|
||
| // no-diag-no-diagnostics | ||
| // expected-warning@#1 {{excess precision is requested but the target does not support excess precision which may result in observable differences in complex division behavior}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.