File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -3795,7 +3795,8 @@ bool ByteCodeExprGen<Emitter>::VisitDeclRefExpr(const DeclRefExpr *E) {
3795
3795
}
3796
3796
} else {
3797
3797
if (const auto *VD = dyn_cast<VarDecl>(D);
3798
- VD && VD->getAnyInitializer () && VD->getType ().isConstQualified ()) {
3798
+ VD && VD->getAnyInitializer () && VD->getType ().isConstQualified () &&
3799
+ !VD->isWeak ()) {
3799
3800
if (!this ->visitVarDecl (VD))
3800
3801
return false ;
3801
3802
// Retry.
Original file line number Diff line number Diff line change @@ -284,3 +284,9 @@ void *foo5 (void)
284
284
{
285
285
return & cv2 ; // pedantic-warning{{address of an expression of type 'void'}}
286
286
}
287
+
288
+ __attribute__((weak )) const unsigned int test10_bound = 10 ;
289
+ char test10_global [test10_bound ]; // all-error {{variable length array declaration not allowed at file scope}}
290
+ void test10 (void ) {
291
+ char test10_local [test10_bound ] = "help" ; // all-error {{variable-sized object may not be initialized}}
292
+ }
You can’t perform that action at this time.
0 commit comments