File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,6 @@ std::optional<unsigned> Program::getOrCreateDummy(const ValueDecl *VD) {
169
169
170
170
std::optional<unsigned > Program::createGlobal (const ValueDecl *VD,
171
171
const Expr *Init) {
172
- assert (!getGlobal (VD));
173
172
bool IsStatic, IsExtern;
174
173
if (const auto *Var = dyn_cast<VarDecl>(VD)) {
175
174
IsStatic = Context::shouldBeGloballyIndexed (VD);
Original file line number Diff line number Diff line change @@ -1209,4 +1209,16 @@ constexpr int externvar1() { // both-error {{never produces a constant expressio
1209
1209
namespace Extern {
1210
1210
constexpr extern char Oops = 1 ;
1211
1211
static_assert (Oops == 1 , " " );
1212
+
1213
+ #if __cplusplus >= 201402L
1214
+ struct NonLiteral {
1215
+ NonLiteral () {}
1216
+ };
1217
+ NonLiteral nl;
1218
+ constexpr NonLiteral &ExternNonLiteralVarDecl () {
1219
+ extern NonLiteral nl;
1220
+ return nl;
1221
+ }
1222
+ static_assert (&ExternNonLiteralVarDecl () == &nl, "");
1223
+ #endif
1212
1224
}
You can’t perform that action at this time.
0 commit comments