File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2665,18 +2665,12 @@ bool ByteCodeExprGen<Emitter>::visitVarDecl(const VarDecl *VD) {
2665
2665
if (P.getGlobal (VD))
2666
2666
return true ;
2667
2667
2668
- // Ignore external declarations. We will instead emit a dummy
2669
- // pointer when we see a DeclRefExpr for them.
2670
- if (VD->hasExternalStorage ())
2671
- return true ;
2672
-
2673
2668
std::optional<unsigned > GlobalIndex = P.createGlobal (VD, Init);
2674
2669
2675
2670
if (!GlobalIndex)
2676
2671
return false ;
2677
2672
2678
- assert (Init);
2679
- {
2673
+ if (Init) {
2680
2674
DeclScope<Emitter> LocalScope (this , VD);
2681
2675
2682
2676
if (VarT) {
@@ -2686,6 +2680,7 @@ bool ByteCodeExprGen<Emitter>::visitVarDecl(const VarDecl *VD) {
2686
2680
}
2687
2681
return this ->visitGlobalInitializer (Init, *GlobalIndex);
2688
2682
}
2683
+ return true ;
2689
2684
} else {
2690
2685
VariableScope<Emitter> LocalScope (this );
2691
2686
if (VarT) {
Original file line number Diff line number Diff line change @@ -1190,6 +1190,11 @@ namespace incdecbool {
1190
1190
constexpr int externvar1 () { // both-error {{never produces a constant expression}}
1191
1191
extern char arr[]; // ref-note {{declared here}}
1192
1192
return arr[0 ]; // ref-note {{read of non-constexpr variable 'arr'}} \
1193
- // expected-note {{indexing of array without known bound}}
1193
+ // expected-note {{array-to-pointer decay of array member without known bound is not supported }}
1194
1194
}
1195
1195
#endif
1196
+
1197
+ namespace Extern {
1198
+ constexpr extern char Oops = 1 ;
1199
+ static_assert (Oops == 1 , " " );
1200
+ }
You can’t perform that action at this time.
0 commit comments