Anastasia added inline comments. ================ Comment at: lib/Sema/SemaInit.cpp:6961 @@ +6960,3 @@ + // the initializer. + if (!Init->isConstantInitializer(S.Context, false)) + break; ---------------- yaxunl wrote: > Anastasia wrote: > > I think you don't need this check any more because this code is inside the > > else part. Could you please double check before committing? > I tried removing this line. There will be extra diagnostics emitted for test > case: > > constant sampler_t glb_smp6 = glb_smp; > > We only expects error msg: `initializer element is not a compile-time > constant`. However in addition to that, we also get `sampler_t initialization > requires 32-bit integer, not '__constant sampler_t'`. This is because the > break is removed. So I think better not removed the line. > Sure! Thanks for checking it!
https://reviews.llvm.org/D21567 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits