File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -3029,7 +3029,7 @@ bool Compiler<Emitter>::VisitCXXConstructExpr(const CXXConstructExpr *E) {
30293029
30303030 size_t NumElems = CAT->getZExtSize ();
30313031 const Function *Func = getFunction (E->getConstructor ());
3032- if (!Func || !Func-> isConstexpr () )
3032+ if (!Func)
30333033 return false ;
30343034
30353035 // FIXME(perf): We're calling the constructor once per array element here,
Original file line number Diff line number Diff line change @@ -865,7 +865,6 @@ constexpr unsigned short ssmall = SS<unsigned short>(100)[42];
865865constexpr auto Ss = SS<S>()[0 ];
866866
867867
868-
869868namespace IncompleteArray {
870869 struct A {
871870 int b = 10 ;
@@ -908,8 +907,19 @@ namespace IncompleteArray {
908907 return c;
909908 }
910909 static_assert (test4() == 12 );
910+ }
911911
912+ namespace NonConstexprArrayCtor {
913+ struct S {
914+ S () {} // both-note 2{{declared here}}
915+ };
912916
917+ constexpr bool test () { // both-error {{never produces a constant expression}}
918+ auto s = new S[1 ]; // both-note 2{{non-constexpr constructor}}
919+ return true ;
920+ }
921+ static_assert (test()); // both-error {{not an integral constant expression}} \
922+ // both-note {{in call to}}
913923}
914924
915925#else
You can’t perform that action at this time.
0 commit comments