summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx0x-cursory-default-delete.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move fixit for const init from note to diag, weaken to warning in MS mode.Nico Weber2015-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r235046 turned "extern __declspec(selectany) int a;" from a declaration into a definition to fix PR23242 (required for compatibility with mc.exe output). However, this broke parsing Windows headers: A d3d11 headers contain something like struct SomeStruct {}; extern const __declspec(selectany) SomeStruct some_struct; This is now a definition, and const objects either need an explicit default ctor or an initializer so this errors out with d3d11.h(1065,48) : error: default initialization of an object of const type 'const CD3D11_DEFAULT' without a user-provided default constructor (cl.exe just doesn't implement this rule, independent of selectany.) To work around this, weaken this error into a warning for selectany decls in microsoft mode, and recover with zero-initialization. Doing this is a bit hairy since it adds a fixit on an error emitted by InitializationSequence – this means it needs to build a correct AST, which in turn means InitializationSequence::Failed() cannot return true when this fixit is applied. As a workaround, the patch adds a fixit member to InitializationSequence, and InitializationSequence::Perform() prints the diagnostic if the fixit member is set right after its call to Diagnose. That function is usually called when InitializationSequences are used – InitListChecker::PerformEmptyInit() doesn't call it, but the InitListChecker case never performs default-initialization, so this is technically OK. This is the alternative, original fix for PR20208 that got reviewed in the thread "[patch] Improve diagnostic on default-initializing const variables (PR20208)". This change basically reverts r213725, adds the original fix for PR20208, and makes the error a warning in Microsoft mode. llvm-svn: 235166
* Add tests for two more asserts that r226365 fixed according to SLi's bot.Nico Weber2015-01-171-0/+12
| | | | llvm-svn: 226371
* Add a test for something that used to crash before r226365.Nico Weber2015-01-171-0/+10
| | | | llvm-svn: 226370
* Improve diagnostic on default-initializing const variables (PR20208).Nico Weber2014-07-231-1/+1
| | | | | | | | This tweaks the diagnostic wording slighly, and adds a fixit on a note. An alternative would be to add the fixit directly on the diagnostic, see the review thread linked to from the bug for a few notes on that approach. llvm-svn: 213725
* PR16638, DR1552: the exception specification on an implicitly-declaredRichard Smith2014-02-071-1/+1
| | | | | | | | | | | 'operator delete' or 'operator delete[]' is an explicit exception specification. Therefore we should diagnose 'void operator delete(void*)' instead of 'void operator delete(void*) noexcept'. This diagnostic remains an ExtWarn, since in practice people don't always include the exception specification in such a declaration. llvm-svn: 201002
* Add implicit declarations of allocation functions when looking them up forRichard Smith2014-02-041-0/+4
| | | | | | | | redeclaration, not just when looking them up for a use -- we need the implicit declaration to appropriately check various properties of them (notably, whether they're deleted). llvm-svn: 200729
* Properly compute triviality for explicitly-defaulted or deleted special members.Richard Smith2012-12-081-7/+11
| | | | | | | | | | | | | | Remove pre-standard restriction on explicitly-defaulted copy constructors with 'incorrect' parameter types, and instead just make those special members non-trivial as the standard requires. This required making CXXRecordDecl correctly handle classes which have both a trivial and a non-trivial special member of the same kind. This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the new triviality computation technology. llvm-svn: 169667
* Explicitly defaulted constructors cannot be used for default initialization.Aaron Ballman2012-07-311-2/+3
| | | | llvm-svn: 161088
* Fold the six functions checking explicitly-defaulted special member functionsRichard Smith2012-05-151-7/+9
| | | | | | | | | | | | into one. These were all performing almost identical checks, with different bugs in each of them. This fixes PR12806 (we weren't setting the exception specification for an explicitly-defaulted, non-user-provided default constructor) and enforces 8.4.2/2's rule that an in-class defaulted member must exactly match the implicit parameter type. llvm-svn: 156802
* Allow thread safety attributes on function definitions.DeLesley Hutchins2012-02-161-0/+6
| | | | | | | | For compatibility with gcc, clang will now parse gcc attributes on function definitions, but issue a warning if the attribute is not a thread safety attribute. Warning controlled by -Wgcc-compat. llvm-svn: 150698
* 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
* constexpr functions are implicitly const. More tests to follow.Richard Smith2011-09-301-1/+1
| | | | llvm-svn: 140831
* Fix some minor bugs and add a lot more test cases for defaultedAlexis Hunt2011-05-171-0/+69
constructors, including two more FIXMEs (one of which I don't actually understand). llvm-svn: 131487
OpenPOWER on IntegriCloud