summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix handling of initialization from parenthesized initializer list.Richard Smith2017-03-241-2/+1
| | | | | | | | | | | | | This change fixes a crash on initialization of a reference from ({}) during template instantiation and incidentally improves diagnostics. This reverts a prior attempt to handle this in r286721. Instead, we teach the initialization code that initialization cannot be performed if a source type is required and the initializer is an initializer list (which is not an expression and does not have a type), and likewise for function-style cast expressions. llvm-svn: 298676
* Fix clang's handling of the copy performed in the second phase of classRichard Smith2016-09-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | copy-initialization. We previously got this wrong in a couple of ways: - we only looked for copy / move constructors and constructor templates for this copy, and thus would fail to copy in cases where doing so should use some other constructor (but see core issue 670), - we mishandled the special case for disabling user-defined conversions that blocks infinite recursion through repeated application of a copy constructor (applying it in slightly too many cases) -- though as far as I can tell, this does not ever actually affect the result of overload resolution, and - we misapplied the special-case rules for constructors taking a parameter whose type is a (reference to) the same class type by incorrectly assuming that only happens for copy/move constructors (it also happens for constructors instantiated from templates and those inherited from base classes). These changes should only affect strange corner cases (for instance, where the copy constructor exists but has a non-const-qualified parameter type), so for the most part it only causes us to produce more 'candidate' notes, but see the test changes for other cases whose behavior is affected. llvm-svn: 280776
* Improve the "braces around scalar init" warning to determine whether to warnRichard Smith2015-02-121-0/+1
| | | | | | | | based on whether "redundant" braces are ever reasonable as part of the initialization of the entity, rather than whether the initialization is "top-level". In passing, add a warning flag for it. llvm-svn: 228896
* A temporary fix for backward compatibility breakages caused by PR12117.Larisse Voufo2015-02-101-3/+4
| | | | llvm-svn: 228654
* Implement the remaining portion of DR1467 from r227022. I may have ↵Larisse Voufo2015-01-271-1/+3
| | | | | | overlooked a few things, but this implementation comes straight from the DR resolution itself. llvm-svn: 227224
* Implement DR990 and DR1070. Aggregate initialization initializes uninitializedRichard Smith2014-06-031-2/+2
| | | | | | | | | elements from {}, rather than value-initializing them. This permits calling an initializer-list constructor or constructing a std::initializer_list object. (It would also permit initializing a const reference or rvalue reference if that weren't explicitly prohibited by other rules.) llvm-svn: 210091
* PR11410: Extend diagnostic to cover all cases of aggregate initialization, notRichard Smith2014-06-031-2/+19
| | | | | | | | | | just the extremely specific case of a trailing array element that couldn't be initialized because the default constructor for the element type is deleted. Also reword the diagnostic to better match our other context diagnostics and to prepare for the implementation of core issue 1070. llvm-svn: 210083
* PR11410 - Confusing diagnostic when trailing array element tries to call ↵Nikola Smiljanic2014-05-301-0/+11
| | | | | | deleted default constructor llvm-svn: 209869
* Tweak diagnostic wording for init list narrowingAlp Toker2014-05-171-2/+2
| | | | | | | | | The conventional form is '<action> to silence this warning'. Also call the diagnostic an 'issue' rather than a 'message' because the latter term is more widely used with reference to message expressions. llvm-svn: 209052
* PR19729: Delete a bunch of bogus code in Sema::FindAllocationOverload. ThisRichard Smith2014-05-131-2/+12
| | | | | | | | | caused us to perform copy-initialization for the parameters of an allocation function called by a new-expression multiple times, resulting in us rejecting allocations that passed non-copyable parameters (and much worse things in MSVC compat mode, where we potentially called this function multiple times). llvm-svn: 208724
* Add some missing diagnostics for C++11 narrowing conversions.Richard Smith2013-02-051-3/+2
| | | | llvm-svn: 174337
* PR13470: Ensure that copy-list-initialization isntantiates asRichard Smith2012-12-191-4/+50
| | | | | | | | | | | | 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
* As we do with base and member initializers in a dependent class, delayDouglas Gregor2012-09-141-0/+16
| | | | | | | | | 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
* PR13273: When performing list-initialization with an empty initializer list,Richard Smith2012-07-051-0/+23
| | | | | | | | | | | 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
* When we determine that an initialization sequence failed due to anDouglas Gregor2012-04-101-0/+14
| | | | | | | | incomplete type, keep track of the actual type that was incomplete. Otherwise, we might fail to produce a diagnostic. Fixes PR12498. llvm-svn: 154432
* Properly handle explicit constructors in list-initialization. Fixes PR12120.Sebastian Redl2012-04-011-6/+14
| | | | llvm-svn: 153849
* Even more careful consideration of C++11 13.3.3.1p4. Fixes PR12241.Sebastian Redl2012-03-271-11/+6
| | | | llvm-svn: 153523
* More careful consideration of C++11 13.3.3.1p4. Fixes PR12257.Sebastian Redl2012-03-201-0/+28
| | | | llvm-svn: 153130
* Turn explicit construction of temporaries using initializer list syntax into ↵Sebastian Redl2012-03-081-0/+18
| | | | | | CXXTemporaryObjectExprs, not just CXXConstructExprs, which have a worrying tendency to vanish. Fixes PR12167. llvm-svn: 152340
* Tentatively fix PR12117. The test case from the bug now passes, and all ↵Sebastian Redl2012-02-291-0/+6
| | | | | | existing tests still pass, but there may still be corner cases. llvm-svn: 151716
* Implement a FIXME for conversion sequence distinction. Should fix PR12092.Sebastian Redl2012-02-271-0/+18
| | | | llvm-svn: 151577
* Fix parsing and processing initializer lists in return statements and as ↵Sebastian Redl2012-02-221-2/+9
| | | | | | direct member initializers. llvm-svn: 151155
* Don't route explicit construction via list-initialization through the ↵Sebastian Redl2012-02-131-5/+16
| | | | | | functional cast code path. It sometimes does the wrong thing, produces horrible error messages, and is just unnecessary. llvm-svn: 150408
* Employ DirectList initialized entities to properly sort through some ↵Sebastian Redl2012-02-121-0/+29
| | | | | | initialization edge cases. llvm-svn: 150342
* Fix parsing new expressions using init lists. Probably still do the wrong ↵Sebastian Redl2012-02-111-0/+68
| | | | | | | | 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
* Overloading for initializer list construction.Sebastian Redl2011-12-221-5/+20
| | | | llvm-svn: 147156
* Fix a parser bug that prevented it from correctly parsing explicit construct ↵Sebastian Redl2011-12-221-1/+1
| | | | | | expressoins of the form T{args}. llvm-svn: 147155
* List-initialization via constructor part 1. Still needs: pretty-printing, ↵Sebastian Redl2011-12-221-0/+66
overloading, initializer_list. llvm-svn: 147145
OpenPOWER on IntegriCloud