summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX
Commit message (Collapse)AuthorAgeFilesLines
...
* Tests for DR301-320.Richard Smith2014-02-031-1/+220
| | | | llvm-svn: 200671
* PR17052 / DR1560 (+DR1550): In a conditional expression between a glvalue and aRichard Smith2014-01-271-0/+20
| | | | | | | throw-expression, the result is also a glvalue and isn't unnecessarily coerced to a prvalue. llvm-svn: 200189
* When a special member is explicitly defaulted outside its class, and we rejectRichard Smith2014-01-222-16/+22
| | | | | | | the defaulting because it would delete the member, produce additional notes explaining why the member is implicitly deleted. llvm-svn: 199829
* Add a test file missed from r199782.Richard Smith2014-01-221-0/+24
| | | | llvm-svn: 199783
* When formatting a C++-only declaration name, enable C++ mode in the formatter'sRichard Smith2014-01-223-4/+4
| | | | | | | | | language options. This is not really ideal -- we should require the right language options to be passed in, or not require language options to format a name -- but it fixes a number of *obviously* wrong formattings. Patch by Olivier Goffart! llvm-svn: 199778
* MSVC 2013 type trait supportAlp Toker2014-01-201-5/+5
| | | | | | | | | | | | | | | | | | | | | Implement type trait primitives used in the latest edition of the Microsoft standard C++ library type_traits header. With this change we can parse much of the Visual Studio 2013 standard headers, particularly anything that includes <type_traits>. Fully implemented, available in all language modes: * __is_constructible() * __is_nothrow_constructible() * __is_nothrow_assignable() Partially implemented, semantic analysis WIP, available as MS extensions: * __is_destructible() * __is_nothrow_destructible() llvm-svn: 199619
* PR12788: Remove unnecessary and incorrect special case for indirect fields.Richard Smith2014-01-171-0/+15
| | | | | | This caused us to skip a step that was essential for correct access control. llvm-svn: 199522
* Don't allow 'this' within typedefs within classes that otherwise look like theyRichard Smith2014-01-171-0/+2
| | | | | | might be member function declarations. Patch by Harald van Dijk! llvm-svn: 199512
* Clean up variable template handling a bit, and correct the behavior of nameRichard Smith2014-01-162-4/+44
| | | | | | lookup when declaring a variable template specialization. llvm-svn: 199438
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-146-14/+14
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* Update tests in preparation for using the MS ABI for Win32 targetsHans Wennborg2014-01-136-16/+61
| | | | | | | | | | In preparation for making the Win32 triple imply MS ABI mode, make all tests pass in this mode, or make them use the Itanium mode explicitly. Differential Revision: http://llvm-reviews.chandlerc.com/D2401 llvm-svn: 199130
* PR18401: Fix assert by implementing the current proposed direction of coreRichard Smith2014-01-091-3/+12
| | | | | | | issue 1430. Don't allow a pack expansion to be used as an argument to an alias template unless the corresponding parameter is a parameter pack. llvm-svn: 198833
* PR18400: ignore cv-qualifiers on the underlying type of an enumeration.Richard Smith2014-01-081-0/+6
| | | | llvm-svn: 198723
* Eliminate UnaryTypeTraitExprAlp Toker2014-01-011-1/+1
| | | | | | | | | | | | | Remove UnaryTypeTraitExpr and switch all remaining type trait related handling over to TypeTraitExpr. The UTT/BTT/TT enum prefix and evaluation code is retained pending further cleanup. This is part of the ongoing work to unify type traits following the removal of BinaryTypeTraitExpr in r197273. llvm-svn: 198271
* Implemented delayed processing of 'unavailable' checking, just like with ↵Ted Kremenek2013-12-184-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | 'deprecated'. Fixes <rdar://problem/15584219> and <rdar://problem/12241361>. This change looks large, but all it does is reuse and consolidate the delayed diagnostic logic for deprecation warnings with unavailability warnings. By doing so, it showed various inconsistencies between the diagnostics, which were close, but not consistent. It also revealed some missing "note:"'s in the deprecated diagnostics that were showing up in the unavailable diagnostics, etc. This change also changes the wording of the core deprecation diagnostics. Instead of saying "function has been explicitly marked deprecated" we now saw "'X' has been been explicitly marked deprecated". It turns out providing a bit more context is useful, and often we got the actual term wrong or it was not very precise (e.g., "function" instead of "destructor"). By just saying the name of the thing that is deprecated/deleted/unavailable we define this issue away. This diagnostic can likely be further wordsmithed to be shorter. llvm-svn: 197627
* Require the type of a by-copy capture to be complete before creating its field.Douglas Gregor2013-12-181-0/+9
| | | | | | | | | | | | The problem here is more serious than the fix implies. Adding a field to a class updates the triviality bits for the class (among other things). Failing to require a complete type before adding the field meant that these updates don't happen in the well-formed case where the capture is an uninstantiated class template specialization, leading the lambda itself to be treated as having a trivial copy constructor when it shouldn't. Fixes <rdar://problem/15560464>. llvm-svn: 197623
* Revert "Don't require -re suffix on -verify directives with regexes."Alp Toker2013-12-149-30/+30
| | | | | | | | | | This patch was submitted to the list for review and didn't receive a LGTM. (In fact one explicit objection and one query were raised.) This reverts commit r197295. llvm-svn: 197299
* Don't require -re suffix on -verify directives with regexes.Hans Wennborg2013-12-149-30/+30
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2392 llvm-svn: 197295
* Eliminate BinaryTypeTraitExprAlp Toker2013-12-131-1/+1
| | | | | | | | | | | | | | | | | There's nothing special about type traits accepting two arguments. This commit eliminates BinaryTypeTraitExpr and switches all related handling over to TypeTraitExpr. Also fixes a CodeGen failure with variadic type traits appearing in a non-constant expression. The BTT/TT prefix and evaluation code is retained as-is for now but will soon be further cleaned up. This is part of the ongoing work to unify type traits. llvm-svn: 197273
* Tighten test regexes checking for __attribute__((thiscall)) on function types.Hans Wennborg2013-12-137-23/+23
| | | | | | | | | | | The tests were perhaps made too relaxed in r197164 when we switched to the new MinGW ABI. This makes sure we check explicitly for an optional thiscall attribute and nothing else. We should still look into whether we should print these attributes at all in these cases. llvm-svn: 197252
* Switch to the new MingW ABI.Rafael Espindola2013-12-128-24/+24
| | | | | | | GCC 4.7 changed the MingW ABI. On the clang side this means that methods now have the thiscall calling convention by default. llvm-svn: 197164
* Change semantics of regex expectations in the diagnostic verifierHans Wennborg2013-12-113-7/+7
| | | | | | | | | | | | | | | | | | | | | | | Previously, a line like // expected-error-re {{foo}} treats the entirety of foo as a regex. This is inconvenient when matching type names containing regex characters. For example, to match "void *(class test8::A::*)(void)" inside such a regex, one would have to type "void \*\(class test8::A::\*\)\(void\)". This patch changes the semantics of expected-error-re to only treat the parts of the directive wrapped in double curly braces as regexes. This avoids the escaping problem and leads to nicer patterns for those cases; see e.g. the change to test/Sema/format-strings-scanf.c. (The balanced search for closing }} of a directive also makes us handle the full directive in test\SemaCXX\constexpr-printing.cpp:41 and :53.) Differential Revision: http://llvm-reviews.chandlerc.com/D2388 llvm-svn: 197092
* Implement DR1460: fix handling of default initializers in unions; don't allowRichard Smith2013-12-103-9/+212
| | | | | | | | | more than one such initializer in a union, make mem-initializers override default initializers for other union members, handle anonymous unions with anonymous struct members better. Fix a couple of semi-related bugs exposed by the tests for same. llvm-svn: 196892
* Delete the now unnecessary test/generic-lambda-unimplemented-1y.cppFaisal Vali2013-12-071-31/+0
| | | | llvm-svn: 196664
* Give a more appropriate diagnostic when a template specialization orRichard Smith2013-12-073-4/+4
| | | | | | | instantiation appears in a non-enclosing namespace (the previous diagnostic talked about the C++98 rule even in C++11 mode). llvm-svn: 196642
* Implement DR482: namespace members can be redeclared with a qualified nameRichard Smith2013-12-054-10/+52
| | | | | | | | | | within their namespace, and such a redeclaration isn't required to be a definition any more. Update DR status page to say Clang 3.4 instead of SVN and add new Clang 3.5 category (but keep Clang 3.4 yellow for now). llvm-svn: 196481
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-051-1/+1
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* Per [dcl.meaning]p1, a name in an inline namespace can be redeclared using aRichard Smith2013-12-051-0/+79
| | | | | | | name from the enclosing namespace set if the name is specified as a qualified-id. llvm-svn: 196464
* Fix several crash-on-invalids when using template-ids that aren'tRichard Smith2013-12-041-1/+26
| | | | | | simple-template-ids (eg, 'operator+<int>') in weird places. llvm-svn: 196333
* Adding the Subjects entry back for the noreturn attributes. This caused some ↵Aaron Ballman2013-11-271-1/+1
| | | | | | test cases to be updated because the original diagnostic was about applying to methods as well as functions, but the semantic checking disallowed methods. llvm-svn: 195862
* Sema: Instantiate local class and their members appropriatelyDavid Majnemer2013-11-271-6/+5
| | | | | | | | | | | We would fail to instantiate them when the surrounding function was instantiated. Instantiate the class and add it's members to the list of pending instantiations, they should be resolved when we are finished with the function's body. This fixes PR9685. llvm-svn: 195827
* Unify lookup from within not-yet-defined defaulted special members: use commonRichard Smith2013-11-273-2/+51
| | | | | | | code for handling triviality, deletedness and constexpr. Fix a few bugs in these, particularly related to mutable members, and remove some dead code. llvm-svn: 195809
* Fix buildbot.Richard Smith2013-11-261-1/+1
| | | | llvm-svn: 195703
* Fix test failure on targets where size_t is unsigned int.Richard Smith2013-11-251-1/+1
| | | | llvm-svn: 195673
* Tests for core issues 270-300.Richard Smith2013-11-252-4/+300
| | | | llvm-svn: 195626
* Take cv-qualifiers on fields of class type into account when determiningRichard Smith2013-11-254-3/+46
| | | | | | whether a defaulted special member function should be deleted. llvm-svn: 195620
* Provide better diagnostic wording for initializers on staticHans Wennborg2013-11-212-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data member definitions when the variable has an initializer in its declaration. For the following code: struct S { static const int x = 42; }; const int S::x = 42; This patch changes the diagnostic from: a.cc:4:14: error: redefinition of 'x' const int S::x = 42; ^ a.cc:2:20: note: previous definition is here static const int x = 42; ^ to: a.cc:4:18: error: static data member 'x' already has an initializer const int S::x = 42; ^ a.cc:2:24: note: previous initialization is here static const int x = 42; ^ Differential Revision: http://llvm-reviews.chandlerc.com/D2235 llvm-svn: 195306
* clang/test/CXX/drs/dr2xx.cpp: Suppress this for targeting LLP64 due to ↵NAKAMURA Takumi2013-11-181-0/+3
| | | | | | | | | | | | __SIZE_TYPE__. Line 559: 'long long' is a C++11 extension Line 566: 'long long' is a C++11 extension Line 674: 'long long' is a C++11 extension See also PR13819. llvm-svn: 195005
* Tests for core issues 251-270.Richard Smith2013-11-181-0/+193
| | | | llvm-svn: 194989
* Tests for core issue 241-250.Richard Smith2013-11-172-1/+124
| | | | llvm-svn: 194951
* Tests for core issues 224-240.Richard Smith2013-11-171-0/+188
| | | | llvm-svn: 194946
* Tests for core issue 216-223.Richard Smith2013-11-151-0/+106
| | | | llvm-svn: 194795
* DR408: If a static data member of incomplete array type is declared in a classRichard Smith2013-11-141-0/+32
| | | | | | | | | | template, that member has a dependent type (even if we can see the definition of the member of the primary template), because the array size could change in a member specialization. Patch by Karthik Bhat! llvm-svn: 194740
* Added warning on structures/unions that are empty or contain onlySerge Pavlov2013-11-141-1/+1
| | | | | | | | | | bit fields of zero size. Warnings are generated in C++ mode and if only such type is defined inside extern "C" block. The patch fixed PR5065. Differential Revision: http://llvm-reviews.chandlerc.com/D2151 llvm-svn: 194653
* Tests for core issue 201-215.Richard Smith2013-11-121-0/+101
| | | | llvm-svn: 194458
* Issue a diagnostic if we see a templated friend declaration that we do notRichard Smith2013-11-082-6/+13
| | | | | | support. llvm-svn: 194273
* clang/test/CXX/drs/dr1xx.cpp: Add explicit triple x86_64-unknown-unknown to ↵NAKAMURA Takumi2013-11-081-3/+3
| | | | | | | | | | | | satisfy check7a and check8a since r194240. For i686 targets and LLP64 targets, we can see; error: 'error' diagnostics seen but not expected: File clang/test/CXX/drs/dr1xx.cpp Line 761: 'check7a' declared as an array with a negative size File clang/test/CXX/drs/dr1xx.cpp Line 765: 'check8a' declared as an array with a negative size 2 errors generated. llvm-svn: 194246
* Tests for core issue 170-200.Richard Smith2013-11-082-0/+297
| | | | llvm-svn: 194240
* Tests for CWG issue 165-170.Richard Smith2013-11-071-0/+54
| | | | llvm-svn: 194215
* Tests for DR150 - DR165.Richard Smith2013-11-071-0/+114
| | | | llvm-svn: 194192
OpenPOWER on IntegriCloud