summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx0x-class.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert r293455, which breaks v8 with a spurious error. Testcase added.Sam McCall2017-01-301-0/+8
| | | | | | | | | | | | Summary: Revert r293455, which breaks v8 with a spurious error. Testcase added. Reviewers: klimek Subscribers: cfe-commits, rsmith Differential Revision: https://reviews.llvm.org/D29271 llvm-svn: 293473
* Fix rejects-valid with default member initializers exposed by r291318.Richard Smith2017-01-101-0/+8
| | | | | | | Don't prematurely clean up an RAII object; there's another RAII object in the same scope that tries to save and restore the same member! llvm-svn: 291551
* Modify the uninitialized field visitor to detect uninitialized use across theRichard Trieu2013-09-201-1/+1
| | | | | | | | | | | | | | | | | | fields in the class. This allows a better checking of member intiailizers and in class initializers in regards to initialization ordering. For instance, this code will now produce warnings: class A { int x; int y; A() : x(y) {} // y is initialized after x, warn here A(int): y(x) {} // default initialization of leaves x uninitialized, warn here }; Several test cases were updated with -Wno-uninitialized to silence this warning. llvm-svn: 191068
* Move -Wstatic-float-init fixit into a note & don't recover as if constexprDavid Blaikie2013-01-291-2/+2
| | | | llvm-svn: 173841
* Don't fixit/recover from -Wstatic-float-init when it's not an error.David Blaikie2013-01-291-2/+2
| | | | | | | Fix to change r173414 that lead to Clang changing const to constexpr even under -Wno-static-float-init. llvm-svn: 173835
* Sync 'in class initialization of static const double' extension up with GCC,Richard Smith2013-01-251-4/+4
| | | | | | | | | | | | | 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
* Bugfix: bogus warning -- "invalid use of non-static data member",DeLesley Hutchins2012-02-251-0/+11
| | | | | | | when a class is forward declared, and the reference to the data member in question does not occur within a method body. llvm-svn: 151413
* Change the diagnostics which said 'accepted as an extension' to instead sayRichard Smith2011-12-291-2/+2
| | | | | | | 'is an extension'. The former is inappropriate and confusing when building with -Werror/-pedantic-errors. llvm-svn: 147357
* constexpr handling improvements. Produce detailed diagnostics when a 'constexpr'Richard Smith2011-12-191-2/+2
| | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 146856
* 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
* Suggest adding 'constexpr' if the GNU extension for in-class initializers ↵Richard Smith2011-09-301-2/+2
| | | | | | 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
* In C++0x, static const volatile data members cannot be initialized in-class.Richard Smith2011-09-291-0/+28
llvm-svn: 140809
OpenPOWER on IntegriCloud