diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-06-03 08:26:00 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-06-03 08:26:00 +0000 |
commit | 454a7cdfb35e492e0539cbc75452229d3a5c5f54 (patch) | |
tree | c63fb6636b1be122d7ebe1ab777d4bfa8c722939 /clang/include/clang/Sema/Initialization.h | |
parent | f05149680450b6543fc676987f601f359a86281f (diff) | |
download | bcm5719-llvm-454a7cdfb35e492e0539cbc75452229d3a5c5f54.tar.gz bcm5719-llvm-454a7cdfb35e492e0539cbc75452229d3a5c5f54.zip |
Implement DR990 and DR1070. Aggregate initialization initializes uninitialized
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
Diffstat (limited to 'clang/include/clang/Sema/Initialization.h')
-rw-r--r-- | clang/include/clang/Sema/Initialization.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/clang/include/clang/Sema/Initialization.h b/clang/include/clang/Sema/Initialization.h index 64e3745dd4f..1b59d2d921e 100644 --- a/clang/include/clang/Sema/Initialization.h +++ b/clang/include/clang/Sema/Initialization.h @@ -401,6 +401,13 @@ public: return SourceLocation::getFromRawEncoding(LocAndNRVO.Location); } + /// \brief If this is an array, vector, or complex number element, get the + /// element's index. + unsigned getElementIndex() const { + assert(getKind() == EK_ArrayElement || getKind() == EK_VectorElement || + getKind() == EK_ComplexElement); + return Index; + } /// \brief If this is already the initializer for an array or vector /// element, sets the element index. void setElementIndex(unsigned Index) { @@ -851,17 +858,17 @@ public: /// /// \param Args the argument(s) provided for initialization. /// - /// \param InInitList true if we are initializing from an expression within - /// an initializer list. This disallows narrowing conversions in C++11 - /// onwards. + /// \param TopLevelOfInitList true if we are initializing from an expression + /// at the top level inside an initializer list. This disallows + /// narrowing conversions in C++11 onwards. InitializationSequence(Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, MultiExprArg Args, - bool InInitList = false); + bool TopLevelOfInitList = false); void InitializeFrom(Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, MultiExprArg Args, - bool InInitList); + bool TopLevelOfInitList); ~InitializationSequence(); |