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) {
26652665 if (P.getGlobal (VD))
26662666 return true ;
26672667
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-
26732668 std::optional<unsigned > GlobalIndex = P.createGlobal (VD, Init);
26742669
26752670 if (!GlobalIndex)
26762671 return false ;
26772672
2678- assert (Init);
2679- {
2673+ if (Init) {
26802674 DeclScope<Emitter> LocalScope (this , VD);
26812675
26822676 if (VarT) {
@@ -2686,6 +2680,7 @@ bool ByteCodeExprGen<Emitter>::visitVarDecl(const VarDecl *VD) {
26862680 }
26872681 return this ->visitGlobalInitializer (Init, *GlobalIndex);
26882682 }
2683+ return true ;
26892684 } else {
26902685 VariableScope<Emitter> LocalScope (this );
26912686 if (VarT) {
Original file line number Diff line number Diff line change @@ -1190,6 +1190,11 @@ namespace incdecbool {
11901190constexpr int externvar1 () { // both-error {{never produces a constant expression}}
11911191 extern char arr[]; // ref-note {{declared here}}
11921192 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 }}
11941194}
11951195#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