Skip to content

Commit 0feb5eb

Browse files
committed
Rollback useless changes and update comment
1 parent 3fd6b57 commit 0feb5eb

File tree

4 files changed

+7
-22
lines changed

4 files changed

+7
-22
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ Bug Fixes in This Version
669669
base classes. (GH139452)
670670
- Fixed an assertion failure in serialization of constexpr structs containing unions. (#GH140130)
671671
- Fixed duplicate entries in TableGen that caused the wrong attribute to be selected. (GH#140701)
672-
- Fixed type mismatch error caused by const structure pointer dereference when builtins parameter is used. (#GH141397)
672+
- Fixed type missmach error when 'builtin-elementwise-math' arguments have different qualifiers, this should be a well-formed. (#GH141397)
673673

674674
Bug Fixes to Compiler Builtins
675675
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/lib/Sema/SemaChecking.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2907,7 +2907,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
29072907
return ExprError();
29082908
}
29092909

2910-
if (!Context.hasSameUnqualifiedType(MagnitudeTy, SignTy)) {
2910+
if (MagnitudeTy.getCanonicalType() != SignTy.getCanonicalType()) {
29112911
return Diag(Sign.get()->getBeginLoc(),
29122912
diag::err_typecheck_call_different_arg_types)
29132913
<< MagnitudeTy << SignTy;
@@ -5265,7 +5265,7 @@ bool Sema::BuiltinComplex(CallExpr *TheCall) {
52655265

52665266
Expr *Real = TheCall->getArg(0);
52675267
Expr *Imag = TheCall->getArg(1);
5268-
if (!Context.hasSameUnqualifiedType(Real->getType(), Imag->getType())) {
5268+
if (!Context.hasSameType(Real->getType(), Imag->getType())) {
52695269
return Diag(Real->getBeginLoc(),
52705270
diag::err_typecheck_call_different_arg_types)
52715271
<< Real->getType() << Imag->getType()
@@ -15607,8 +15607,8 @@ bool Sema::BuiltinElementwiseTernaryMath(
1560715607
}
1560815608

1560915609
for (int I = 1; I < 3; ++I) {
15610-
if (!Context.hasSameUnqualifiedType(Args[0]->getType(),
15611-
Args[I]->getType())) {
15610+
if (Args[0]->getType().getCanonicalType() !=
15611+
Args[I]->getType().getCanonicalType()) {
1561215612
return Diag(Args[0]->getBeginLoc(),
1561315613
diag::err_typecheck_call_different_arg_types)
1561415614
<< Args[0]->getType() << Args[I]->getType();

clang/test/Sema/builtins-elementwise-math.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,8 @@ void test_builtin_elementwise_fma(int i32, int2 v2i32, short i16,
12071207
typedef struct {
12081208
float3 b;
12091209
} struct_float3;
1210-
// This example uncovered a bug #141397
1210+
// This example uncovered a bug #141397 :
1211+
// Type missmach error when 'builtin-elementwise-math' arguments have different qualifiers, this should be a well-formed
12111212
float3 foo(float3 a,const struct_float3* hi) {
12121213
float3 b = __builtin_elementwise_max((float3)(0.0f), a);
12131214
return __builtin_elementwise_pow(b, hi->b.yyy);

clang/test/SemaCXX/bug141397.cpp

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)