File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -359,8 +359,14 @@ QualType Descriptor::getType() const {
359
359
360
360
QualType Descriptor::getElemQualType () const {
361
361
assert (isArray ());
362
- const auto *AT = cast<ArrayType>(getType ());
363
- return AT->getElementType ();
362
+ QualType T = getType ();
363
+ if (const auto *AT = T->getAsArrayTypeUnsafe ())
364
+ return AT->getElementType ();
365
+ if (const auto *CT = T->getAs <ComplexType>())
366
+ return CT->getElementType ();
367
+ if (const auto *CT = T->getAs <VectorType>())
368
+ return CT->getElementType ();
369
+ llvm_unreachable (" Array that's not an array/complex/vector type?" );
364
370
}
365
371
366
372
SourceLocation Descriptor::getLocation () const {
Original file line number Diff line number Diff line change @@ -81,3 +81,13 @@ namespace VectorElementExpr {
81
81
static_assert (twoElts.x == 22 , " " ); // ref-error {{not an integral constant expression}}
82
82
static_assert (twoElts.y == 33 , " " ); // ref-error {{not an integral constant expression}}
83
83
}
84
+
85
+ namespace Temporaries {
86
+ typedef __attribute__ ((vector_size(16 ))) int vi4a;
87
+ typedef __attribute__ ((ext_vector_type(4 ))) int vi4b;
88
+ struct S {
89
+ vi4a v;
90
+ vi4b w;
91
+ };
92
+ int &&s = S().w[1 ];
93
+ }
You can’t perform that action at this time.
0 commit comments