summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX
Commit message (Collapse)AuthorAgeFilesLines
...
* Re-commit r217995 and follow-up patches (r217997, r218011, r218053). These wereRichard Smith2014-10-161-1/+8
| | | | | | | | | | | | | | | reverted in r218058 because they triggered a rejects-valid bug in MSVC. Original commit message from r217995: Instantiate exception specifications when instantiating function types (other than the type of a function declaration). We previously didn't instantiate these at all! This also covers the pathological case where the only mention of a parameter pack is within the exception specification; this gives us a second way (other than alias templates) to reach the horrible state where a type contains an unexpanded pack, but its canonical type does not. llvm-svn: 219977
* PR21180: Lambda closure types are neither aggregates nor literal types.Richard Smith2014-10-072-1/+6
| | | | llvm-svn: 219222
* Revert r218925 - "Patch to warn if 'override' is missing"Alexander Potapenko2014-10-031-4/+4
| | | | | | | | | | | | | | | | | | | | This CL has caused bootstrap failures on Linux and OSX buildbots running with -Werror. Example report from http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/13183/steps/bootstrap%20clang/logs/stdio: ================================================================ [ 91%] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/ShowEnabledWarnings.cpp.o In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp:20: In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIISelLowering.h:19: /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIInstrInfo.h:71:8: error: 'getLdStBaseRegImmOfs' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] bool getLdStBaseRegImmOfs(MachineInstr *LdSt, ^ /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/include/llvm/Target/TargetInstrInfo.h:815:16: note: overridden virtual function is here virtual bool getLdStBaseRegImmOfs(MachineInstr *LdSt, ^ ================================================================ llvm-svn: 218969
* Patch to warn if 'override' is missingFariborz Jahanian2014-10-021-4/+4
| | | | | | | | | | | | for an overriding method if class has at least one 'override' specified on one of its methods. Reviewed by Doug Gregor. rdar://18295240 (I have already checked in all llvm files with missing 'override' methods and Bob Wilson has fixed a TableGen of FastISel so no warnings are expected from build of llvm after this patch. I have already verified this). llvm-svn: 218925
* Tests for DR600-640.Richard Smith2014-09-291-0/+347
| | | | llvm-svn: 218591
* Fix "unsupported friend" diagnostic to also appear for friend functions with ↵Richard Smith2014-09-291-4/+4
| | | | | | dependent scopes. llvm-svn: 218590
* Run DR tests in C++17 mode too.Richard Smith2014-09-2812-12/+24
| | | | llvm-svn: 218580
* Don't perform ADL when looking up operator=; there is no non-member form ofRichard Smith2014-09-231-4/+4
| | | | | | | | | that function, and apart from being slow, this is unnecessary: ADL can trigger instantiations that are not permitted here. The standard isn't *completely* clear here, but this seems like the intent, and in any case this approach is permitted by [temp.inst]p7. llvm-svn: 218330
* Revert r217995 and follow-ups:Hans Wennborg2014-09-181-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r218053: Use exceptions() instead of getNumExceptions()/getExceptionType() to avoid r218011: Work around MSVC parser bug by putting redundant braces around the body of r217997: Skip parens when detecting whether we're instantiating a function declaration. r217995: Instantiate exception specifications when instantiating function types (other The Windows build was broken for 16 hours and no one had any good ideas of how to fix it. Reverting for now to make the builders green. See the cfe-commits thread [1] for more info. This was the build error (from [2]): C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\clang\lib\Sema\SemaTemplateInstantiate.cpp(1590) : error C2668: '`anonymous-namespace'::TemplateInstantiator::TransformFunctionProtoType' : ambiguous call to overloaded function C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\clang\lib\Sema\SemaTemplateInstantiate.cpp(1313): could be 'clang::QualType `anonymous-namespace'::TemplateInstantiator::TransformFunctionProtoType<clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>>(clang::TypeLocBuilder &,clang::FunctionProtoTypeLoc,clang::CXXRecordDecl *,unsigned int,Fn)' with [ Fn=clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735> ] c:\bb-win7\ninja-clang-i686-msc17-r\llvm-project\clang\lib\sema\TreeTransform.h(4532): or 'clang::QualType clang::TreeTransform<Derived>::TransformFunctionProtoType<clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>>(clang::TypeLocBuilder &,clang::FunctionProtoTypeLoc,clang::CXXRecordDecl *,unsigned int,Fn)' with [ Derived=`anonymous-namespace'::TemplateInstantiator, Fn=clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735> ] while trying to match the argument list '(clang::TypeLocBuilder, clang::FunctionProtoTypeLoc, clang::CXXRecordDecl *, unsigned int, clang::Sema::SubstFunctionDeclType::<lambda_756edcbe7bd5c7584849a6e3a1491735>)' 1. http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140915/115011.html 2. http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/10515/steps/build_clang_tools_1/logs/stdio llvm-svn: 218058
* Change -Wbind-to-temporary-copy from an ExtWarn to an Extension.Nico Weber2014-09-181-1/+1
| | | | | | | | | | | | | | | | | The reasoning is that this construct is accepted by all compilers and valid in C++11, so it doesn't seem like a useful warning to have enabled by default. Building with -pedantic, -Wbind-to-temporary-copy, or -Wc++98-compat still shows the warning. The motivation is that I built re2, and this was the only warning that was emitted during the build. Both changing re2 to fix the warning and detecting clang and suppressing the warning in re2's build seem inferior than just giving the compiler a good default for this warning. Also move the cxx98compat version of this warning to CXX98CompatPedantic, and update tests accordingly. llvm-svn: 218008
* Instantiate exception specifications when instantiating function types (otherRichard Smith2014-09-171-1/+8
| | | | | | | | | | than the type of a function declaration). We previously didn't instantiate these at all! This also covers the pathological case where the only mention of a parameter pack is within the exception specification; this gives us a second way (other than alias templates) to reach the horrible state where a type contains an unexpanded pack, but its canonical type does not. llvm-svn: 217995
* Tests for DR581-600.Richard Smith2014-09-151-0/+140
| | | | llvm-svn: 217844
* Tests for DR573-580.Richard Smith2014-09-111-0/+126
| | | | llvm-svn: 217606
* Reword switch/goto diagnostics "protected scope" diagnostics. Making up a termRichard Smith2014-09-067-12/+12
| | | | | | | | "protected scope" is very unhelpful here and actively confuses users. Instead, simply state the nature of the problem in the diagnostic: we cannot jump from here to there. The notes explain nicely why not. llvm-svn: 217293
* clang/test/CXX/drs/dr5xx.cpp: Fix up assumption of thiscall. It affects not ↵NAKAMURA Takumi2014-09-051-2/+2
| | | | | | | | x64 but x86. Note, i686-cygwin doesn't use thiscall. llvm-svn: 217234
* Remove suppression of dr547 test and instead test that deduction succeeds if weRichard Smith2014-09-051-6/+14
| | | | | | | | use __thiscall. (This doesn't actually work for MSVC; they don't allow the __thiscall qualifier here, but it's sufficient to demonstrate that we do implement the intent of the DR.) llvm-svn: 217213
* clang/test/CXX/drs/dr5xx.cpp: Suppress dr547 also for MinGWHans Wennborg2014-09-041-1/+2
| | | | | | This is a follow-up to r216841. llvm-svn: 217204
* PR20844: If we fail to list-initialize a reference, map to the referenced typeRichard Smith2014-09-041-7/+8
| | | | | | | | | before retrying the initialization to produce diagnostics. Otherwise, we may fail to produce any diagnostics, and silently produce invalid AST in a -Asserts build. Also add a note to this codepath to make it more clear why we were trying to create a temporary. llvm-svn: 217197
* Avoid test failure on platforms where size_t is long long (and thus can't beRichard Smith2014-09-021-3/+4
| | | | | | directly written in strictly-conforming source code). llvm-svn: 216969
* Tests for DR550-572.Richard Smith2014-09-022-1/+189
| | | | llvm-svn: 216953
* clang/test/CXX/drs/dr5xx.cpp: Suppress dr547 for targeting MSVC x86 for now, ↵NAKAMURA Takumi2014-08-311-0/+2
| | | | | | | | | | | | | | | | | | | due to incompatibility of attribute(thiscall). With targeting i686-win32, error: 'error' diagnostics seen but not expected: File clang/test/CXX/drs/dr5xx.cpp Line 521: implicit instantiation of undefined template 'dr547::X<void () __attribute__((thiscall)) const>' File clang/test/CXX/drs/dr5xx.cpp Line 518: implicit instantiation of undefined template 'dr547::X<void () __attribute__((thiscall)) const>' File clang/test/CXX/drs/dr5xx.cpp Line 518: implicit instantiation of undefined template 'dr547::X<void () __attribute__((thiscall)) const>' error: 'note' diagnostics seen but not expected: File clang/test/CXX/drs/dr5xx.cpp Line 516: template is declared here File clang/test/CXX/drs/dr5xx.cpp Line 521: in instantiation of function template specialization 'dr547::f<void () __attribute__((thiscall)) const, dr547::S>' requested here File clang/test/CXX/drs/dr5xx.cpp Line 516: template is declared here File clang/test/CXX/drs/dr5xx.cpp Line 516: template is declared here 7 errors generated. llvm-svn: 216841
* Tests for DR525-550.Richard Smith2014-08-311-0/+316
| | | | llvm-svn: 216834
* Fix for PR20660, where unexpanded parameter pack in function parameter ↵Larisse Voufo2014-08-291-0/+27
| | | | | | clause causes clang to crash. llvm-svn: 216778
* C++1y is now C++14!Aaron Ballman2014-08-197-34/+34
| | | | | | Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording. llvm-svn: 215982
* Reject varargs '...' in function prototype if there are more parameters afterRichard Smith2014-08-112-3/+2
| | | | | | | | | | | it. Diagnose with recovery if it appears after a function parameter that was obviously supposed to be a parameter pack. Otherwise, warn if it immediately follows a function parameter pack, because the user most likely didn't intend to write a parameter pack followed by a C-style varargs ellipsis. This warning can be syntactically disabled by using ", ..." instead of "...". llvm-svn: 215408
* Sema: Disallow taking the address of a bitfield coming from preincrementDavid Majnemer2014-07-311-0/+1
| | | | | | | | | | | | | | Clang forgot that '++s.m' was a bitfield l-value and permit it's address to be taken; this would crash at CodeGen-time. Instead, propagate the object-kind when we see the prefix increment/decrement. This fixes PR20496. Differential Revision: http://reviews.llvm.org/D4733 llvm-svn: 214386
* Improving the "integer constant too large" diagnostics based on post-commit ↵Aaron Ballman2014-07-241-1/+1
| | | | | | feedback from Richard Smith. Amends r213657. llvm-svn: 213865
* Improve diagnostic on default-initializing const variables (PR20208).Nico Weber2014-07-235-9/+9
| | | | | | | | 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
* Provide extra information in the "integer constant is too large" diagnostic. ↵Aaron Ballman2014-07-221-1/+1
| | | | | | This will be used to improve other diagnostics. llvm-svn: 213657
* Mark C++ reference parameters as dereferenceableHal Finkel2014-07-181-2/+2
| | | | | | | | | | | | | | Because references must be initialized using some evaluated expression, they must point to something, and a callee can assume the reference parameter is dereferenceable. Taking advantage of a new attribute just added to LLVM, mark them as such. Because dereferenceability in addrspace(0) implies nonnull in the backend, we don't need both attributes. However, we need to know the size of the object to use the dereferenceable attribute, so for incomplete types we still emit only nonnull. llvm-svn: 213386
* Revert "clang/test/Driver/crash-report.c: This requires rewriter for ↵Alp Toker2014-07-163-3/+0
| | | | | | | | | | | | | | | | | | | | | -frewrite-includes. [PR20321]" We've decided to make the core rewriter class and PP rewriters mandatory. They're only a few hundred lines of code in total and not worth supporting as a distinct build configuration, especially since doing so disables key compiler features. This reverts commit r213150. Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter." This reverts commit r213148. Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/" This reverts commit r213146. llvm-svn: 213159
* clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.NAKAMURA Takumi2014-07-163-0/+3
| | | | llvm-svn: 213148
* Don't accept qualified 'int' main return types in C++ or standard C modeAlp Toker2014-07-021-0/+2
| | | | | | | | | C++ [basic.start.main]p1: "It shall have a return type of type int" ISO C is also clear about this, so only accept 'int' with qualifiers in GNUMode C. llvm-svn: 212171
* Add missing "non-constant" diagnostic for a member call on a temporary ofRichard Smith2014-06-111-1/+1
| | | | | | non-literal class type. llvm-svn: 210696
* Implement DR990 and DR1070. Aggregate initialization initializes uninitializedRichard Smith2014-06-032-0/+78
| | | | | | | | | elements from {}, rather than value-initializing them. This permits calling an initializer-list constructor or constructing a std::initializer_list object. (It would also permit initializing a const reference or rvalue reference if that weren't explicitly prohibited by other rules.) llvm-svn: 210091
* List DR532 as implemented on the defect report status page by renaming the ↵Nikola Smiljanic2014-06-031-2/+2
| | | | | | namespace. llvm-svn: 210080
* Move DR532 test where it belongs.Nikola Smiljanic2014-06-032-16/+16
| | | | llvm-svn: 210064
* The exception-declaration for a function-try-block cannot redeclare aAaron Ballman2014-06-022-4/+14
| | | | | | | function parameter. One of our existing test cases was XFAILed because of this. This fixes the issue and un-XFAILs the test. llvm-svn: 210026
* Revert "Fix the undefined-but-used odr-use marker (DR48)"Alp Toker2014-06-011-3/+4
| | | | | | | | Wrong patch got committed (this one isn't ready for prime time). This reverts commit r209996. llvm-svn: 209997
* Fix the undefined-but-used odr-use marker (DR48)Alp Toker2014-06-011-4/+3
| | | | | | | | | | | | | We should treat tentative definitions as undefined for the purpose of ODR-use linkage checking. This broke somewhere around r149731 when tests were disabled. Note that test coverage for these diagnostics is generally lacking due to a separate issue (PR19910: Don't suppress unused/undefined warnings when there are errors). llvm-svn: 209996
* PR12961 - Extend DR532 to cover C++98/03.Nikola Smiljanic2014-05-312-63/+37
| | | | llvm-svn: 209955
* This test is no longer relevant. It is covered already by ↵Aaron Ballman2014-05-301-5/+0
| | | | | | [basic.scope.pdecl]p10, and our current test for that is more thorough (though our test is named p9.cpp). llvm-svn: 209892
* This test should no longer be XFAILed; the standard has stabilized, and the ↵Aaron Ballman2014-05-301-13/+12
| | | | | | test contents are acceptable. No diagnostics expected from this test. llvm-svn: 209891
* Test requires exceptionsAlp Toker2014-05-281-1/+1
| | | | | | It's still XFAIL, but slightly closer to passing. llvm-svn: 209729
* Add 'nonnull' parameter or return attribute when producing an llvm pointer ↵Nick Lewycky2014-05-281-2/+2
| | | | | | type in a function type where the C++ type is a reference. Update the tests. llvm-svn: 209723
* Rejecting the mutable specifier on a freestanding type declaration, instead ↵Aaron Ballman2014-05-261-3/+2
| | | | | | of supporting it as a "extension" (which serves no purpose). Un-XFAILing the test for mutable specifiers. llvm-svn: 209635
* Sema: Implement DR244David Majnemer2014-05-212-5/+11
| | | | | | | | | | | | | | | | Summary: Naming the destructor using a typedef-name for the class-name is well-formed. This fixes PR19620. Reviewers: rsmith, doug.gregor Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3583 llvm-svn: 209319
* Clean up language and grammar.Eric Christopher2014-05-201-1/+1
| | | | | | | Based on a patch by jfcaron3@gmail.com! PR19806 llvm-svn: 209215
* This test doesn't need to be XFAILed anywhere; it just needed to be updated ↵Aaron Ballman2014-05-191-4/+3
| | | | | | to the appropriate diagnostic wording. llvm-svn: 209140
* More fixes for isBetterOverloadCandidate not being a strict weak ordering. TheRichard Smith2014-05-171-0/+18
| | | | | | bug was obvious from inspection, figuring out a way to test it was... less so. llvm-svn: 209060
OpenPOWER on IntegriCloud