Commit Graph

18 Commits

Author SHA1 Message Date
Richard Smith 6b21696ee8 Add some missing diagnostics for C++11 narrowing conversions.
llvm-svn: 174337
2013-02-05 05:52:24 +00:00
Richard Smith d59b832320 PR13470: Ensure that copy-list-initialization isntantiates as
copy-list-initialization (and doesn't add an additional copy step):

Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it
when instantiating initializers in order to correctly handle instantiation of
copy-list-initialization. Teach TreeTransform that function arguments are
initializations, and so need this special treatment too. Finally, remove some
hacks which were working around SubstInitializer's shortcomings.

llvm-svn: 170489
2012-12-19 01:39:02 +00:00
Douglas Gregor 6d149412c8 As we do with base and member initializers in a dependent class, delay
type checking for non-static data member initializers in a dependent
class, because our ASTs lose too much information to when
type-checking an initializer. Fixes <rdar://problem/11974632>,
although the result is still rather unsatisfactory.

llvm-svn: 163871
2012-09-14 04:20:37 +00:00
Richard Smith d86812d95c PR13273: When performing list-initialization with an empty initializer list,
actually perform value initialization rather than trying to fake it with a call
to the default constructor. Fixes various bugs related to the previously-missing
zero-initialization in this case.

I've also moved this and the other list initialization 'special case' from
TryConstructorInitialization into TryListInitialization where they belong.

llvm-svn: 159733
2012-07-05 08:39:21 +00:00
Douglas Gregor 85f3423509 When we determine that an initialization sequence failed due to an
incomplete type, keep track of the actual type that was
incomplete. Otherwise, we might fail to produce a diagnostic. Fixes
PR12498.

llvm-svn: 154432
2012-04-10 20:43:46 +00:00
Sebastian Redl 048a6d7976 Properly handle explicit constructors in list-initialization. Fixes PR12120.
llvm-svn: 153849
2012-04-01 19:54:59 +00:00
Sebastian Redl e541716286 Even more careful consideration of C++11 13.3.3.1p4. Fixes PR12241.
llvm-svn: 153523
2012-03-27 18:33:03 +00:00
Sebastian Redl d9170b09e6 More careful consideration of C++11 13.3.3.1p4. Fixes PR12257.
llvm-svn: 153130
2012-03-20 21:24:14 +00:00
Sebastian Redl 04fe1bf52e Turn explicit construction of temporaries using initializer list syntax into CXXTemporaryObjectExprs, not just CXXConstructExprs, which have a worrying tendency to vanish. Fixes PR12167.
llvm-svn: 152340
2012-03-08 21:05:45 +00:00
Sebastian Redl c7b718eb53 Tentatively fix PR12117. The test case from the bug now passes, and all existing tests still pass, but there may still be corner cases.
llvm-svn: 151716
2012-02-29 12:47:43 +00:00
Sebastian Redl aa6feaa7ea Implement a FIXME for conversion sequence distinction. Should fix PR12092.
llvm-svn: 151577
2012-02-27 22:38:26 +00:00
Sebastian Redl eef474ce1b Fix parsing and processing initializer lists in return statements and as direct member initializers.
llvm-svn: 151155
2012-02-22 10:50:08 +00:00
Sebastian Redl 2b80af4949 Don't route explicit construction via list-initialization through the functional cast code path. It sometimes does the wrong thing, produces horrible error messages, and is just unnecessary.
llvm-svn: 150408
2012-02-13 19:55:43 +00:00
Sebastian Redl 5a41f68fe2 Employ DirectList initialized entities to properly sort through some initialization edge cases.
llvm-svn: 150342
2012-02-12 16:37:24 +00:00
Sebastian Redl 82ace98d55 Fix parsing new expressions using init lists. Probably still do the wrong thing in cases involving array new.
Show that many cases using initializer list constructors work, in that they parse and pass semantic analysis.

llvm-svn: 150316
2012-02-11 23:51:08 +00:00
Sebastian Redl 6901c0de67 Overloading for initializer list construction.
llvm-svn: 147156
2011-12-22 18:58:38 +00:00
Sebastian Redl 867f228a55 Fix a parser bug that prevented it from correctly parsing explicit construct expressoins of the form T{args}.
llvm-svn: 147155
2011-12-22 18:58:29 +00:00
Sebastian Redl ed2e53222f List-initialization via constructor part 1. Still needs: pretty-printing, overloading, initializer_list.
llvm-svn: 147145
2011-12-22 14:44:04 +00:00