]> granicus.if.org Git - clang/commit
PR36055: fix computation of *-dependence in nested initializer lists.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 7 Feb 2018 22:25:16 +0000 (22:25 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 7 Feb 2018 22:25:16 +0000 (22:25 +0000)
commitc7097a4d7052ebc15e85c2a7f46a47bd7304aa21
tree8245e6828cdb32d6478008aa9037f6461010b47a
parent19347d7065a90fecbe8efd7f9f48b91f0f1319e6
PR36055: fix computation of *-dependence in nested initializer lists.

When we synthesize an implicit inner initializer list when analyzing an outer
initializer list, we add it to the outer list immediately, and then fill in the
inner list. This gives the outer list no chance to update its *-dependence bits
with those of the completed inner list. To fix this, re-add the inner list to
the outer list once it's completed.

Note that we do not recompute the *-dependence bits from scratch when we
complete an outer list; this would give the wrong result for the case where a
designated initializer overwrites a dependent initializer with a non-dependent
one. The resulting list in that case should still be dependent, even though all
traces of the dependence were removed from the semantic form.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324537 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaInit.cpp
test/SemaCXX/init-expr-crash.cpp
test/SemaTemplate/instantiate-init.cpp