Skip to content

Commit 3fd6b57

Browse files
committed
fixup! [Sema] built-in args type checking using hasSameUnqualifiedType
1 parent 5e6d0a5 commit 3fd6b57

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +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)
672673

673674
Bug Fixes to Compiler Builtins
674675
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
typedef double double2 __attribute__((ext_vector_type(2)));
44
typedef double double4 __attribute__((ext_vector_type(4)));
55
typedef float float2 __attribute__((ext_vector_type(2)));
6+
typedef float float3 __attribute__((ext_vector_type(3)));
67
typedef float float4 __attribute__((ext_vector_type(4)));
78

89
typedef int int2 __attribute__((ext_vector_type(2)));
@@ -1202,3 +1203,12 @@ void test_builtin_elementwise_fma(int i32, int2 v2i32, short i16,
12021203
c3 = __builtin_elementwise_fma(f32, f32, c3);
12031204
// expected-error@-1 {{3rd argument must be a scalar or vector of floating-point types (was '_Complex float')}}
12041205
}
1206+
1207+
typedef struct {
1208+
float3 b;
1209+
} struct_float3;
1210+
// This example uncovered a bug #141397
1211+
float3 foo(float3 a,const struct_float3* hi) {
1212+
float3 b = __builtin_elementwise_max((float3)(0.0f), a);
1213+
return __builtin_elementwise_pow(b, hi->b.yyy);
1214+
}

0 commit comments

Comments
 (0)