summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class/class.static/class.static.data/p3.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't warn about runtime behavior problems in variable initializers that weRichard Smith2017-09-231-1/+1
| | | | | | | | know are going to be constant-evaluated. Any relevant diagnostics should be produced by constant expression evaluation. llvm-svn: 314067
* Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives aRichard Smith2016-06-251-3/+12
| | | | | | | variable weak discardable linkage and partially-ordered initialization, and is implied for constexpr static data members.) llvm-svn: 273754
* Move -Wstatic-float-init fixit into a note & don't recover as if constexprDavid Blaikie2013-01-291-1/+1
| | | | llvm-svn: 173841
* Sync 'in class initialization of static const double' extension up with GCC,Richard Smith2013-01-251-1/+1
| | | | | | | | | | | | | and split it out of -Wgnu into its own warning flag. * In C++11, this is now a hard error (GCC has no extension here in C++11 mode). The error can be disabled with -Wno-static-float-init, and has a fixit to add 'constexpr'. * In C++98, this is still an ExtWarn, but is now controlled by -Wstatic-float-init as well as -Wgnu. llvm-svn: 173414
* Deal with a horrible C++11 special case. If a non-literal type has a constexprRichard Smith2012-02-131-3/+3
| | | | | | | | | | | constructor, and that constructor is used to initialize an object of static storage duration such that all members and bases are initialized by constant expressions, constant initialization is performed. In this case, the object can still have a non-trivial destructor, and if it does, we must emit a dynamic initializer which performs no initialization and instead simply registers that destructor. llvm-svn: 150419
* Update constexpr implementation to match CWG's chosen approach for core issuesRichard Smith2012-02-131-4/+3
| | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 150359
* Further testing for instantiation of out-of-line constexpr static data memberRichard Smith2012-01-191-0/+5
| | | | | | template definitions. llvm-svn: 148506
* An instantiation of a constexpr static data member in a class template isRichard Smith2012-01-191-0/+14
| | | | | | constexpr. llvm-svn: 148505
* constexpr: static data members declared constexpr are required to have anRichard Smith2011-11-071-1/+1
| | | | | | | | 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. llvm-svn: 144028
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* PR11067: A definition of a constexpr static variable doesn't need an ↵Richard Smith2011-10-061-1/+3
| | | | | | initializer if the in-class declaration had one. Such a declaration must be initialized by a constant expression. llvm-svn: 141279
* Suggest adding 'constexpr' if the GNU extension for in-class initializers ↵Richard Smith2011-09-301-1/+1
| | | | | | for static const float members is used in C++11 mode. llvm-svn: 140828
* Mark the ExtWarn for in-class initialization of static const float members ↵Richard Smith2011-09-291-2/+2
| | | | | | as a GNU extension. Don't extend the scope of this extension to all literal types in C++0x mode. llvm-svn: 140820
* constexpr: semantic checking for constexpr variables.Richard Smith2011-09-291-0/+24
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). llvm-svn: 140801
OpenPOWER on IntegriCloud