History log of /external/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
86c3ae46250cdcc57778c27826060779a92f3815 13-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Update constexpr implementation to match CWG's chosen approach for core issues
1358, 1360, 1452 and 1453.
- Instantiations of constexpr functions are always constexpr. This removes the
need for separate declaration/definition checking, which is now gone.
- This makes it possible for a constexpr function to be virtual, if they are
only dependently virtual. Virtual calls to such functions are not constant
expressions.
- Likewise, it's now possible for a literal type to have virtual base classes.
A constexpr constructor for such a type cannot actually produce a constant
expression, though, so add a special-case diagnostic for a constructor call
to such a type rather than trying to evaluate it.
- Classes with trivial default constructors (for which value initialization can
produce a fully-initialized value) are considered literal types.
- Classes with volatile members are not literal types.
- constexpr constructors can be members of non-literal types. We do not yet use
static initialization for global objects constructed in this way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.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/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.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/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp
66f85713bd0d22f867efa8e9fb0037befdd6b151 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: static data members declared constexpr are required to have an
initializer; all other constexpr variables are merely required to be
initialized. In particular, a user-provided constexpr default constructor can be
used for such initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp
762bb9d0ad20320b9f97a841dce57ba5e8e48b07 14-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Update all tests other than Driver/std.cpp to use -std=c++11 rather than
-std=c++0x. Patch by Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp
c6d990a767150b02337de1136fdb55ccf349f4d1 29-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: semantic checking for constexpr variables.

We had an extension which allowed const static class members of floating-point type to have in-class initializers, 'as a C++0x extension'. However, C++0x does not allow this. The extension has been kept, and extended to all literal types in C++0x mode (with a fixit to add the 'constexpr' specifier).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p9.cpp