File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -401,7 +401,7 @@ class ToConstElemVisitor : public Visitor {
401
401
return ;
402
402
}
403
403
404
- // address of indexExp
404
+ /* address of indexExp
405
405
if (auto iexp = e->e1->isIndexExp()) {
406
406
// indexee must be global static array var
407
407
VarExp *vexp = iexp->e1->isVarExp();
@@ -426,6 +426,7 @@ class ToConstElemVisitor : public Visitor {
426
426
result = gep;
427
427
return;
428
428
}
429
+ */
429
430
430
431
if (auto se = e->e1 ->isStructLiteralExp ()) {
431
432
result = p->getStructLiteralGlobal (se);
@@ -449,12 +450,7 @@ class ToConstElemVisitor : public Visitor {
449
450
return ;
450
451
}
451
452
452
- if (e->e1 ->op == EXP::slice || e->e1 ->op == EXP::dotVariable) {
453
- visit (static_cast <Expression *>(e));
454
- return ;
455
- }
456
-
457
- llvm_unreachable (" unsupported AddrExp in ToConstElemVisitor" );
453
+ visit (static_cast <Expression *>(e));
458
454
}
459
455
460
456
// ////////////////////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change
1
+ // RUN: not %ldc -c %s 2>&1 | FileCheck %s
2
+
3
+ // CHECK: gh4938.d(4): Error: expression `&"whoops"w[0]` is not a constant
4
+ immutable (wchar )* x = &" whoops" w[0 ];
You can’t perform that action at this time.
0 commit comments