]> granicus.if.org Git - clang/commit
When performing template argument deduction for an initializer list,
authorDouglas Gregor <dgregor@apple.com>
Wed, 4 Apr 2012 05:10:53 +0000 (05:10 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 4 Apr 2012 05:10:53 +0000 (05:10 +0000)
commitd280389b42bb55cd8969eae181dc3ff9f05e9aaf
treee75b6665dfd1e830eca7bd514747fe26092f262d
parenta9b55a499a8b5ae0c4b373f751ef62af74ec494e
When performing template argument deduction for an initializer list,
be sure to perform the argument type adjustments in
[temp.deduct.call]p2, e.g., array decay.

And, when performing these deductions in the context of 'auto', make
sure that we're deducing the P' in std::initializer_list<P'> rather
than the whole initializer list.

Together, this makes code like

  for( auto s : {"Deferred", "New", "Open", "Review"}) { }

work properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153998 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaTemplateDeduction.cpp
test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp