History log of /external/clang/test/SemaCXX/constant-expression-cxx11.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4967a710c84587c654b56c828382219c3937dacb 20-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master Clang for rebase to r275480

Bug: http://b/31320715

This merges commit ac9cc4764cf47a6c3f031687d8592e080c9f5001 from
aosp/dev.

Test: Build AOSP and run RenderScript tests (host tests for slang and
libbcc, RsTest, CTS)

Change-Id: Ic2875e5c3673c83448cd7d1013861e42947b1b55
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
87d948ecccffea9e9e37d0d053b246e2d6d6c47b 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r256229

http://b/26987366

Change-Id: I5d349c9843ea5c24d6e455956f8a446393b6873d
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
b6d6993e6e6d3daf4d9876794254d20a134e37c2 01-Jul-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r239765

Change-Id: I0393bcc952590a7226af8c4b58534a8ee5fd2d99
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
0e2c34f92f00628d48968dfea096d36381f494cb 23-Mar-2015 Stephen Hines <srhines@google.com> Update aosp/master clang for rebase to r230699.

Change-Id: I6a546ab3d4ae37119eebb735e102cca4f80ab520
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
176edba5311f6eff0cad2631449885ddf4fbc9ea 01-Dec-2014 Stephen Hines <srhines@google.com> Update aosp/master Clang for rebase to r222490.

Change-Id: Ic557ac55e97fbf6ee08771c7b7c3594777b0aefd
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
c568f1e98938584c0ef0b12ae5018ff7d90a4072 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
e21432efa94079aa1a62f7d5ff3b47a92d3c8296 15-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Modern gcc is happy to constant evaluate __builtin_strlen in various cases
where we didn't. Extend our constant evaluation for __builtin_strlen to handle
any constant array of chars, not just string literals, to match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
baa9af171fd7ac6ff6a1b5ca09bf77168c1728e7 07-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17800: When performing pack expansion, we must always rebuild the AST nodes
to avoid breaking AST invariants by reusing Stmt nodes within the same
function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f490f0eaba5fed6236d8f8a965a2fd98fa41e891 05-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor constant expression handling and make a couple of tweaks to make it a
bit more robust against future changes. This includes a slight diagnostic
improvement: if we know we're only trying to form a constant expression, take
the first diagnostic which shows the expression is not a constant expression,
rather than preferring the first one which makes the expression unfoldable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
1fca547913774c6c547a15414d1a7051c1f446b5 13-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Part three of PR15721: if we have an invalid CXXDefaultInitExpr, don't crash if
we try to constant-evaluate it. Patch by Karthik Bhat, test by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
812d6bcbd13190e6e5c2c915bf1499038d56b44b 10-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR5683: Issue a warning when subtracting pointers to types of zero size, and
treat such subtractions as being non-constant. Patch by Serge Pavlov! With a
few tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
3835a4ef050da466038844274d79f1fc9d77c0f1 06-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16755: When initializing or modifying a bitfield member in a constant
expression, truncate the stored value to the size of the bitfield.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
03ce5f8c68f55405db6001e82bdb18581d0dadce 24-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: track object lifetime during constexpr evaluation, and don't allow
objects to be used once their lifetimes end. This completes the C++1y
constexpr extensions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
5fb478be9b91f15624e855e7bd6ac2101021ac48 28-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Fix error recovery with in-class initializer.

Previously, for a field with an invalid in-class initializer, we
would create a CXXDefaultInitExpr referring to a null Expr*.
This is not a good idea.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
db2fe739e5aac227d85d149efc9036696997a26f 25-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> More of N3652: don't add an implicit 'const' to 'constexpr' member functions when checking for overloads in C++1y.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
37a84f653c196aa0b73fad96707175a62dcb6a12 20-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16377: Allow evaluation of statement expressions in constant evaluation,
why not. Apparently GCC supports this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
41cb3d90c2114a7df7aa04f80c8be4b62994fb0d 15-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix handling of const_cast from prvalue to rvalue reference: such a cast is
only permitted if the source object is of class type, and should materialize a
temporary for the reference to bind to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f050d2445ed75569ccfe0740caa900403d2ce3b3 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement core issue 903: only integer literals with value 0 and prvalues of
type std::nullptr_t are null pointer constants from C++11 onwards.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
7c3e615f01e8f9f587315800fdaf2305ed824568 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR12086, PR15117

Introduce CXXStdInitializerListExpr node, representing the implicit
construction of a std::initializer_list<T> object from its underlying array.
The AST representation of such an expression goes from an InitListExpr with a
flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr
containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr).

This more detailed representation has several advantages, the most important of
which is that the new MaterializeTemporaryExpr allows us to directly model
lifetime extension of the underlying temporary array. Using that, this patch
*drastically* simplifies the IR generation of this construct, provides IR
generation support for nested global initializer_list objects, fixes several
bugs where the destructors for the underlying array would accidentally not get
invoked, and provides constant expression evaluation support for
std::initializer_list objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
b6e3808bfe385da8d90bb431e41e30d721d5433f 08-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Recursively lifetime-extend into array temporaries. These can get implicitly
created through binding a reference-to-array to an initializer list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f69dd33cfc0b1f2a6c88d10951dbd29c4dc806c2 06-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> When a static storage duration temporary appears in a constant expression, it
must be initialized by a constant expression (not just a core constant
expression), because we're going to emit it as a global. Core issue for this is
pending.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
211c8ddb5b500ed84833751363d0cfe1115f4dd3 05-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Model temporary lifetime-extension explicitly in the AST. Use this model to
handle temporaries which have been lifetime-extended to static storage duration
within constant expressions. This correctly handles nested lifetime extension
(through reference members of aggregates in aggregate initializers) but
non-constant-expression emission hasn't yet been updated to do the same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
8a66bf78becf05a24e8251379f3843d1fceb627f 03-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor constant expression evaluation to associate the complete object of a
materialized temporary with the corresponding MaterializeTemporaryExpr. This is
groundwork for providing C++11's guaranteed static initialization for global
references bound to lifetime-extended temporaries (if the initialization is a
constant expression).

In passing, fix a couple of bugs where some evaluation failures didn't trigger
diagnostics, and a rejects-valid where potential constant expression testing
would assume that it knew the dynamic type of *this and would reject programs
which relied on it being some derived type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
5705f211472f19fc38e58d81365f9261024b3ba3 23-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR14772: Support constant expression evaluation for _Atomic types.
* Treat _Atomic(T) as a literal type if T is a literal type.
* Evaluate expressions of this type properly.
* Fix a lurking bug where we built completely bogus ASTs for converting to
_Atomic types in C++ in some cases, caught by the tests for this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f039e3eb0ffa87aae0e38cec48f367ee179b4de6 14-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Suppress bogus "use of undefined constexpr function" error if the function body
was erroneous and got discarded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
30ae1ed71dc99a396b7ddba9cabe9846a0c4449d 05-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Handle parens properly when initializing a char array from a string literal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
a07a6c3e756d0a6a5baa2cad9d165f79f0fb1b42 01-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15884: In the 'taking the address of a temporary' extension, materialize the
temporary to an lvalue before taking its address. This removes a weird special
case from the AST representation, and allows the constant expression evaluator
to deal with it without (broken) hacks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
bebf5b1bcfbf591dd3cd80c4aebd6486bb34f41c 26-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: support simple variable assignments in constexpr functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
a10b97898ee6339c3110e6ca33f178ff52f05238 22-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y constexpr extensions, round 1: Allow most forms of declaration and
statement in constexpr functions. Everything which doesn't require variable
mutation is also allowed as an extension in C++11. 'void' becomes a literal
type to support constexpr functions which return 'void'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
99ad35921aa6c1b200b6432c066961f930fce1e1 22-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix array constant expression evaluation bug: we can have different values for
different array elements, even if they're all constructed using the same
default constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
840462670ba7a6bc26265a2306b35f2f0f01f51c 21-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> The 'constexpr implies const' rule for non-static member functions is gone in
C++1y, so stop adding the 'const' there. Provide a compatibility warning for
code relying on this in C++11, with a fix-it hint. Update our lazily-written
tests to add the const, except for those ones which were testing our
implementation of this rule.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f2705196d83a162665d4350bf3bb464972974ee3 31-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Clarify the diagnostic for -Wnested-anon-types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
c5f7d6aed586fc492383255633c7ea5591256bfe 28-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add a -pedantic warning: an anonymous union within an anonymous union is not
permitted in standard C++, despite being silently accepted by many (all?) major
C++ implementations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
ce2661f9ccb85de1aacaa7c3ea414a757f5986f6 07-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11851 (and duplicates): Whenever a constexpr function is referenced,
instantiate it if it can be instantiated and implicitly define it if it can be
implicitly defined. This matches g++'s approach. Remove some cases from
SemaOverload which were marking functions as referenced when just planning how
overload resolution would proceed; such cases are not actually references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
9568f0c13a84695c5cc064e7c32412f84604cb1e 29-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Partially roll back r166898; it exposed a bug in the standard.

The problem is as follows: C++11 has contexts which are not
potentially-evaluated, and yet in which we are required or encouraged to
perform constant evaluation. In such contexts, we are not permitted to
implicitly define special member functions for literal types, therefore
we cannot evalaute those constant expressions.

Punt on this in one more context for now by skipping checking constexpr
variable initializers if they occur in dependent contexts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
1432a43e3076eec84967305bd85bace3a6e9102b 28-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> When determining whether to try evaluating the initializer of a variable, check
whether the initializer is value-dependent rather than whether we are in a
dependent context. This allows us to detect some errors sooner, and fixes a
crash-on-invalid if a dependent type leaks out to a non-dependent context in
error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
e925322569cb4aad26cc62036a13e2d3daed862d 25-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14171: Don't crash if we hit one of the paths where GetFullTypeForDeclarator
rebuilds a function type, and that function type has parens around its name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
9be36ab27b874b404099650e0c29bc92f3c7662d 18-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1535: only potentially-evaluated typeid expressions are disallowed in constant
expressions, not *any* typeid on a polymorphic class type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
01cad02220180b9646525295f502c00c64a172d0 01-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix treatment of case which came up on std-proposals@: 'void' is permitted in core constant expressions, despite not being a literal type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
48def65d1cfbd020c5d4a7e542a00d63808c6060 29-Aug-2012 Hans Wennborg <hans@hanshq.net> Move TLS check from LValueExprEvaluator::VisitVarDecl to
CheckLValueConstantExpression.

Richard pointed out that using the address of a TLS variable is ok in a
core C++11 constant expression, as long as it isn't part of the eventual
result of constant expression evaluation. Having the check in
CheckLValueConstantExpression accomplishes this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
29f431b3e310ae6bd367dccf5a2794ad1cac9592 29-Aug-2012 Hans Wennborg <hans@hanshq.net> Fix r162835 as per Richard's comments.

VisitVarDecl should return Error(E), and we should test that the address
of a TLS var can't be used as a constexpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
50800fc551ac6b8a95cca662223e7f061bbd169a 08-Aug-2012 David Blaikie <dblaikie@gmail.com> Implement warning for integral null pointer constants other than the literal 0.

This is effectively a warning for code that violates core issue 903 & thus will
become standard error in the future, hopefully. It catches strange null
pointers such as: '\0', 1 - 1, const int null = 0; etc...

There's currently a flaw in this warning (& the warning for 'false' as a null
pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
for example). Fix to come in a future patch.

Also, due to this only being a warning, not an error, it triggers quite
frequently on gtest code which tests expressions for null-pointer-ness in a
SFINAE context (so it wouldn't be a problem if this was an error as in an
actual implementation of core issue 903). To workaround this for now, the
diagnostic does not fire in unevaluated contexts.

Review by Sean Silva and Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
604fb38cd943649bee579103d17ca6cda4aad144 08-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> When building a conditional operator where one operand is a throw-expression
and the other is a glvalue of class type, don't forget to copy-initialize a
temporary when performing the lvalue-to-rvalue conversion on the glvalue.
Strangely, DefaultLvalueConversions misses this part of the lvalue-to-rvalue
conversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
a4334dffde250c22c339a974a7131914fe723180 11-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix crash when constant-evaluating a CXXConstructExpr representing
value-initialization for an array of class type with a trivial default
constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
de31aa7f0ef71f5c162372e319cbc03c0924f074 08-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13290: Constant-evaluation support for CXXConstructExprs which construct a
multidimensional array of class type. Also, preserve zero-initialization when
evaluating an initializer list for an array, in case the initializers refer to
later elements (which have preceding zero-initialization).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
20599392a99956eaac4cf351a0935574090cb6c3 07-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12670: Support for initializing an array of non-aggregate class type from an
initializer list. Patch by Olivier Goffart, with extra testcases by Meador Inge
and Daniel Lunow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f4bb8d06c4f1665f89a9e9ddd61f2a2d26904da0 05-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
622da859b816036290b7e6f046521e4dea388361 02-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Additional testing for fixes in r158289 and r158290 to allow implicitly-declared
constructors for non-literal types to be constexpr in some circumstances.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
e92b1f4917bfb669a09d220dc979fc3676df4da8 26-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix lifetime issue for backing APValue of OpaqueValueExpr in recursive
constexpr function evaluation, and corresponding ASan / valgrind issue in
tests, by storing the corresponding value with the relevant stack frame. This
also prevents re-evaluation of the source of the underlying OpaqueValueExpr,
which makes a major performance difference for certain contrived code (see
testcase update).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
dbbecccb8431bb4545fc01c6401abc4253667360 15-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12826: Converting an lvalue to an xvalue is a no-op conversion, not an lvalue-to-rvalue conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
8d59deec807ed53efcd07855199cdc9c979f447f 01-May-2012 John McCall <rjmccall@apple.com> My first effort to do this more subtly failed, so elaborately
test for an invalid declaration at every single place in the
constant evaluator that's about to request a struct layout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
fe587201feaebc69e6d18858bea85c77926b6ecf 15-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12226: don't generate wrong code if a braced string literal is used to
initialize an array of unsigned char. Outside C++11 mode, this bug was benign,
and just resulted in us emitting a constant which was double the required
length, padded with 0s. In C++11, it resulted in us generating an array whose
first element was something like i8 ptrtoint ([n x i8]* @str to i8).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
4b1f684416980ef6f1a7cb9e6af9c4fa4a164617 13-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Allow vectors to be constructed from constexpr function arguments in
constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
1cb2d742eb6635aeab6132ee5f0b5781d39487d7 02-Mar-2012 Nico Weber <nicolasweber@gmx.de> Add -Wstring-plus-int, which warns on "str" + int and int + "str".

It doesn't warn if the integer is known at compile time and within
the bounds of the string.

Discussion: http://comments.gmane.org/gmane.comp.compilers.clang.scm/47203



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
16581335fc32abcbc6ab14eda7af38cf759664b7 02-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Ensure that we instantiate static reference data members of class templates
early, since their values can be used in constant expressions in C++11. For
odr-use checking, the opposite change is required, since references are
odr-used whether or not they satisfy the requirements for appearing in a
constant expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
86024013d4c3728122c58fa07a2a67e6c15837ef 18-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement constant expression support for __real__ and __imag__ on lvalue
complex numbers. Treat complex numbers as arrays of the corresponding component
type, in order to make std::complex behave properly if implemented in terms of
_Complex T.

Apparently libstdc++'s std::complex is implemented this way, and we were
rejecting a member like this:

constexpr double real() { return __real__ val; }

because it was marked constexpr but unable to produce a constant expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
b78ae9716576399145786b93f687943f8b197170 18-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix a problem in the GCC testsuite, exposed by r150557. Compound literals
are represented as prvalues in C++; don't be fooled into thinking they're
global lvalues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f3908f2ae111b1b12ade2524dda71c669ed6f121 17-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Make sure all remaining parts of the constant evaluator are aware that an array
can be represented by an LValue, and use that to simplify the code a little.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
74e1ad93fa8d6347549bcb10279fdf1fbc775321 16-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr tidyups:
* Fix bug when determining whether && / || are potential constant expressions
* Try harder when determining whether ?: is a potential constant expression
* Produce a diagnostic on sizeof(VLA) to provide a better source location


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
83587db1bda97f45d2b5a4189e584e2a18be511a 15-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR1454. This allows all intermediate results in constant expressions
to be core constant expressions (including pointers and references to
temporaries), and makes constexpr calculations Turing-complete. A Turing machine
simulator is included as a testcase.

This opens up the possibilty of removing CCValue entirely, and removing some
copies from the constant evaluator in the process, but that cleanup is not part
of this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
b4e5e286a5cd156247720b1eb204abaa8e09568d 09-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> CWG issue 1405: mutable members are allowed in literal types, but can't undergo
lvalue-to-rvalue conversions in constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
2fd5983e0da447291a651a347c206aee37a1de5f 08-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR1458: Taking the address of an object of incomplete class type is
not a constant expression, because we can't tell whether the complete class type
will have an overloaded operator&.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
9ec7197796a2730d54ae7f632553b5311b2ba3b5 05-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: Fix implementation of DR1311: check for volatile qualifiers in
lvalue-to-rvalue conversions on the source type of the conversion, not the
target type (which has them removed for non-class types).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f15fda02e9c8c82b4a716618f4010b9af8bff796 02-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr:
* support the gcc __builtin_constant_p() ? ... : ... folding hack in C++11
* check for unspecified values in pointer comparisons and pointer subtractions


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
b02e4629f78a0c0c0adf9d66b644e5932a781c7e 01-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: add support for comparisons of pointer-to-members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
745f5147e065900267c85a5568785a1991d4838f 27-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: Implement the [dcl.constexpr]p5 check for whether a constexpr
function definition can produce a constant expression. This also provides the
last few checks for [dcl.constexpr]p3 and [dcl.constexpr]p4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f2e4cd760a5836ee8941d1b9be6b2e2c2dde23e6 26-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: evaluate (bool)&x as true when x is a local variable or a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
d9b02e726262e4009dda830998bb934172ac0020 25-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: add support for anonymous struct and union members in literal types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
495f42a32610c03591b49cd06ac09c5408742f86 24-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add a test for a diagnostic special case added in r148439, as requested by
Francois Pichet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
8ef7b203332b0c8d65876a1f5e6d1db4e6f40e4b 19-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: converted constant expression handling for enumerator values, case
values and non-type template arguments of integral and enumeration types.

This change causes some legal C++98 code to no longer compile in C++11 mode, by
enforcing the C++11 rule that narrowing integral conversions are not permitted
in the final implicit conversion sequence for the above cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
6b3014b07c40a6ed8b0c8ed63950df02eeb82c28 18-Jan-2012 Eli Friedman <eli.friedman@gmail.com> The value of a case statement is a potentially evaluated context. Found by inspection.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
7d580a4e9e47dffc3c17aa2b957ac57ca3c4e451 17-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Enable constant evaluation of implicit calls to constexpr conversion operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148333 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
244ee7b89a483fd3764637abdf95de2893b437d0 15-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Pedantic diagnostic correction: in C++, we have integral constant expressions,
not integer constant expressions. In passing, fix the 'folding is an extension'
diagnostic to not claim we're accepting the code, since that's not true in
-pedantic-errors mode, and add this diagnostic to -Wgnu.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
28c1ce789322ab99f9b5887015d63ec5f088957a 15-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: casts to void* are allowed in constant expressions, don't set the
designator invalid. (Since we can't read the value of such a pointer, this only
affects the quality of diagnostics.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f6c17a439f3320ac620639a3ee66dbdabb93810c 14-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Fix a silly mistake in ComplexExprEvaluator::ZeroInitialization. <rdar://problem/10691092>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
ec789163a42a7be654ac34aadb750b508954d53c 12-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: initialization of a union from an empty initializer-list should
zero-initialize the first union member. Also fix a bug where initializing an
array of types compatible with wchar_t from a wide string literal failed in C,
and fortify the C++ tests in this area. This part can't be tested without a code
change to enable array evaluation in C (where an existing test fails).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
7ead5c7b6fd48cf549e55b4db499c26ecf88ae75 10-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Implement the missing pieces of Evaluate for _Complex types. With that complete, remove some code from CGExprConstant which is no longer necessary. While I'm here, a couple minor tweaks to _Complex-in-C++. (Specifically, make _Complex types literal types, and don't warn for _Complex int.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
610a60c0e68e34db5a5247d6102e58f37510fef8 10-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11724: Implement evaluation for constexpr defaulted trivial union copy/move
constructors. These are a special case whose behavior cannot be modeled as a
user-written constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
b4e85ed51905fc94378d7b4ff62b06e0d08042b7 06-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expressions: implement checking and diagnostics for
pointer-arithmetic-related undefined behavior and unspecified results. We
continue to fold such values, but now notice they aren't constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
d7c56e1114bfe7d461786903bb720d2c6efc05a1 29-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Change the diagnostics which said 'accepted as an extension' to instead say
'is an extension'. The former is inappropriate and confusing when building with
-Werror/-pedantic-errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
dd4b350143c26c030a482f091908a2e077503411 25-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix constexpr handling to allow 'extern constexpr' variable declarations. We no
longer have access to the source locations we need to produce the
'replace constexpr with const' fixits, so they're gone for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
6180245e9f63d2927b185ec251fb75aba30f1cac 22-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11614: Mark defaulted special constructors as constexpr if their implicit
definition would satisfy the constexpr requirements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
974c5f93d0ce4f0699a6f0a4402f6b367da495e3 22-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11637: implement special-case constant evaluation for char arrays initialized
by string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
7098cbd601ad915aed22d4b5850da99359f25bf3 21-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in
constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
1d238ea926bbdd04356ce475934fcd4cac654c4b 21-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 half of r147023: In C++11, additionally eagerly instantiate:
- constexpr function template instantiations
- variables of reference type
- constexpr variables


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
bc6abe93a5d6b1305411f8b6f54c2caa686ddc69 19-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Evaluation support for ExprWithCleanups. We won't evaluate any expression which
actually requires non-trivial cleanups, so no cleanups need to be performed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
af2c7a194592401394233b7cbcdd3cfd0a7a38dd 19-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Improve r146813 (for PR11595) to give an appropriate diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
099e7f647ccda915513f2b2ec53352dc756082d3 19-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr handling improvements. Produce detailed diagnostics when a 'constexpr'
variable is initialized by a non-constant expression, and pass in the variable
being declared so that earlier-initialized fields' values can be used.

Rearrange VarDecl init evaluation to make this possible, and in so doing fix a
long-standing issue in our C++ constant expression handling, where we would
mishandle cases like:

extern const int a;
const int n = a;
const int a = 5;
int arr[n];

Here, n is not initialized by a constant expression, so can't be used in an ICE,
even though the initialization expression would be an ICE if it appeared later
in the TU. This requires computing whether the initializer is an ICE eagerly,
and saving that information in PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f59ff8c777379bd54137853a58c58b72fb869152 17-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Add a missing check before trying to evaluate a temporary. PR11595.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
08d6e032a2a0a8656d12b3b7b93942987bb12eb7 16-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 constexpr: Add note stacks containing backtraces if constant evaluation
fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit
argument to driver and frontend, to control the maximum number of notes so
produced (default 10). Fix APValue printing to be able to pretty-print all
APValue types, and move the testing for this functionality from a unittest to
a -verify test now that it's visible in clang's output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
daaefc5381f9aafbb1cb6f88fb5ac6aaf34d65bf 15-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Produce more detailed diagnostics when static_assert condition is not an ICE.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
c1c5f27c64dfc3332d53ad30e44d626e4f9afac3 13-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add checks and diagnostics for many of the cases which C++11 considers to not
be constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
60f24e781484250d3602261477d16321db7a157b 12-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Further tweaking of diagnostic text for casts performing reinterpret_cast
conversions in constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
4cd9b8f7fb2cebf614e6e2bc766fad27ffd2e9de 12-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Clean up diagnostic wording for disallowed casts in C++11 constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
c216a01c96d83bd9a90e214af64913e93d39aacc 12-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 constant expression cast restrictions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
9eed49c2bb0f37bbfefefd0998b6303a686a66c0 10-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Mechanically convert static_assert_fold to static_assert, now we implement the
C++11 ICE rules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f48fdb0937e67f691393f9ffdf75653e5128ea13 09-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 constant expressions: Don't use CheckICE in C++11; instead, determine
whether an expression is a (core) constant expression as a side-effect of
evaluation. This takes us from accepting far too few expressions as ICEs to
accepting slightly too many -- fixes for the remaining cases are coming next.

The diagnostics produced when an expression is found to be non-constant are
currently quite poor (with generic wording but reasonable source locations),
and will be improved in subsequent commits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
a5aa96d01f2f8750a4756ca74c8e172384a54602 24-Nov-2011 Matt Beaumont-Gay <matthewbg@google.com> Wordsmith the -Warray-bounds diagnostic text a bit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
e24f5fc8c763f1b5536b8d70dd510ca959db3a80 17-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: add support for evaluation of member pointers
and base-to-derived casts, and add proper handling of temporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
1bf9a9e6a5bdc0de7939908855dcddf46b661800 12-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Represent an APValue based on a Decl as that Decl, rather than a DeclRefExpr
or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to
static member functions and static data members are now emitted as constant
expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
f64699e8db3946e21b5f4a0421cbc58a3e439599 11-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evalation: const_cast support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
59efe266b804330f4c1f3a1b0ff783e67dd90378 11-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for constexpr member functions. This
reinstates r144273; a combination of r144333's fix for NoOp rvalue-to-lvalue
casts and some corresponding changes here resolve the regression which that
caused.

This patch also adds support for some additional forms of member function call,
along with additional testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
6142ca7790aa09a6e13592b70f142cc4bbcadcae 10-Nov-2011 Devang Patel <dpatel@apple.com> Revert r144273. It causes clang self-host build failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
6c95787b25c72a1c2421e349ef3459912362714a 10-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for constexpr member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
180f47959a066795cc0f409433023af448bb0328 10-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for evaluation of structs and unions of
literal types, as well as derived-to-base casts for lvalues and
derived-to-virtual-base casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
3d75ca836205856077c18e30e9447accbd85f751 09-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for default arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
db1822c6de43ff4aa5fa00234bf8222f6f4816e8 08-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix a cluster of related issues involving value-dependence and constant
expression evaluation:
- When folding a non-value-dependent expression, we may try to use the
initializer of a value-dependent variable. If that happens, give up.
- In C++98, actually check that a const, non-volatile DeclRefExpr inside an ICE
is of integral or enumeration type (a reference isn't OK!)
- In C++11, DeclRefExprs for objects of const literal type initialized with
value-dependent expressions are themselves value-dependent.
- So are references initialized with value-dependent expressions (though this
case is missing from the C++11 standard, along with many others).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
cc5d4f637cdf83adc174b96d2bfe27cef1cf0f36 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for arrays.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
9a17a680c74ef661bf3d864029adf7e74d9cb5b8 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: preserve subobject designator when flattening a
core constant value down to an APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
cd689927139d3ab52c0c088521633c661bd2d807 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Allow constexpr variables' initializers to be folded in C++11 mode. This
partially undoes the revert in r143491, but does not introduce any new instances
of the underlying issue (which is not yet fixed) in code which does not use
the 'constexpr' keyword.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
545d1bbf91c01e3d72e6e5074311ace6b3f86b26 04-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Clean up C++11 constant expression testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143720 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
0a3bdb646ee0318667f4cebec6792d2548fb9950 04-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: track the manner in which an lvalue was written,
to allow us to implement the C++11 rule that a non-active union member can't be
read, and use it to implement subobject access for string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
0b4072f42f4c94c6c396b43ed3db4d1deecef9c3 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix r143463 to test what it was intended to test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143505 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
344d78d6a669fb324f89937fc0739f97670f4700 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Temporarily disable lvalue-to-rvalue conversions on const pointers while an
apparent miscompile triggered by this is investigated. This is essentially a
revert of r143298.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
177dce777596e68d111d6d3e6046f3ddfc96bd07 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 'constexpr calls must return constant expressions' rule, and
perform the code simplifications this rule allows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
ffbda40a1fb7169591dc01771f3511178a2f727c 31-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Don't try to fold comparisons between the address of an object and an arbitrary integer constant. Fixes regression from r143334.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
7a420df78dd207d505b0c05d5f4b12a627b8b994 31-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Add missing lvalue-to-rvalue conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
bd552efbeff3a64a1c400d2bba18f13f84abd8ab 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expression handling: evaluation support for
materialized temporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
9e36b533af1b2fa9f32c4372c4081abdd86f47e0 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expressions: evaluate equality comparisons between
arbitrary pointers, if those pointers don't point to weak objects or literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
625b80755b603d28f36fb4212c81484d87ad08d3 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expressions: support pointer comparisons where the
result is not unspecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
b78c0b66481a59dbef7ac2a454e4f89448909749 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr evaluation: allow lvalue-to-rvalue conversion on any literal type, not
just integers and floating point types. Since we don't support evaluating class
types or performing lvalue-to-rvalue conversions on array elements yet, this
just means pointer types right now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
47a1eed1cdd36edbefc318f29be6c0f3212b0c41 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr function substitution:
Track the function invocation where an lvalue referring to a constexpr function
parameter originated from, and use it to substitute the correct argument and to
determine whether such an argument's lifetime has ended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
d0dcceae2a8ca0e37b5dd471a704de8583d49c95 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Initial support for C++11 constexpr function invocation substitution. Using
constexpr function arguments outside of their function (passing or returning
them by reference) does not work correctly yet.

Calling constexpr function templates does not work yet, since the bodies are not
instantiated until the end of the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
c49bd11f96c2378969822f1f1b814ffa8f2bfee4 28-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Reinstate r142844 (reverted in r142872) now that lvalue-to-rvalue conversions
are present in all the necessary places:

In constant expression evaluation, evaluate lvalues as lvalues and rvalues as
rvalues. Remove special case for caching reference initialization and fix a
cyclic initialization crash in the process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp
4f87062cb411d5a31cf39f1ac576bba4123930f2 28-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix some cases where a CK_IntegralCast was being used to convert an lvalue to an
rvalue. An assertion to catch this is in ImpCastExprToType will follow, but
vector operations currently trip over this (due to omitting the usual arithmetic
conversions). Also add an assert to catch missing lvalue-to-rvalue conversions
on the LHS of ->.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaCXX/constant-expression-cxx11.cpp