summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/virtual-override.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Mark DR1250 as implementedDavid Majnemer2016-02-011-12/+0
| | | | | | | We implemented this DR back in r258768 but forgot to mark it as implemented. llvm-svn: 259335
* [Sema] Incomplete types are OK for covariant returnsDavid Majnemer2016-01-261-0/+12
| | | | | | | | | | Per C++14 [class.virtual]p8, it is OK for the return type's class type to be incomplete so long as the return type is the same between the base and complete classes. This fixes PR26297. llvm-svn: 258768
* PR6037Nathan Sidwell2015-01-191-1/+1
| | | | | | Warn on inaccessible direct base llvm-svn: 226423
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-2/+2
| | | | | | | | | | | | | | | 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
* Better diagnostic for static override when methods are thiscall by defaultHans Wennborg2013-12-111-1/+2
| | | | | | | | | | | | | | | | | | Methods are thiscall by default in the MS ABI, and also in MinGW targetting GCC 4.7 or later. This changes the diagnostic from the technically correct but hard to understand: virtual function 'foo' has different calling convention attributes ('void ()') than the function it overrides (which has calling convention 'void () __attribute__((thiscall))') to the more intuitive and also correct: 'static' member function 'foo' overrides a virtual function We already have a test for this. Let's just run it in both ABI modes. Differential Revision: http://llvm-reviews.chandlerc.com/D2375 llvm-svn: 197055
* 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
* Fix PR8767, improve diagnostic wording when allocating an object of anChandler Carruth2011-02-181-1/+1
| | | | | | | | abstract class type. Patch by Stephen Hines, with a wording tweak from Doug applied by me. llvm-svn: 125996
* When parsing an out-of-line member function declaration, we must delayJohn McCall2011-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | access-control diagnostics which arise from the portion of the declarator following the scope specifier, just in case access is granted by friending the individual method. This can also happen with in-line member function declarations of class templates due to templated-scope friend declarations. We were really playing fast-and-loose before with this sort of thing, and it turned out to work because *most* friend functions are in file scope. Making us delay regardless of context exposed several bugs with how we were manipulating delay. I ended up needing a concept of a context that's independent of the declarations in which it appears, and then I actually had to make some things save contexts correctly, but delay should be much cleaner now. I also encapsulated all the delayed-diagnostics machinery in a single subobject of Sema; this is a pattern we might want to consider rolling out to other components of Sema. llvm-svn: 125485
* Enhance the diagnostic for negative array sizes to include theChandler Carruth2011-01-041-1/+1
| | | | | | | | | | | declaration name of the array when present. This ensures that a poor-man's C++03 static_assert will include the user error message often embedded in the name. Update all the tests to reflect the new wording, and add a test for the name behavior. llvm-svn: 122802
* Diagnose when a 'static' member function overrides a virtual functionDouglas Gregor2010-10-131-0/+12
| | | | | | in a base class. Fixes PR8168. llvm-svn: 116448
* 'const std::type_info*' instead of 'std::type_info const*'Chris Lattner2010-09-051-1/+1
| | | | llvm-svn: 113092
* Turn access control on by default in -cc1.John McCall2010-04-091-1/+1
| | | | | | | | Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. llvm-svn: 100880
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-11/+11
| | | | | | | | | | therefore not creating ElaboratedTypes, which are still pretty-printed with the written tag). Most of these testcase changes were done by script, so don't feel too sorry for my fingers. llvm-svn: 98149
* Defer covariance checks for dependent types. Add test cases that also ensureChandler Carruth2010-02-151-0/+23
| | | | | | they are re-checked on instantiation. llvm-svn: 96217
* Improve access control diagnostics. Perform access control on member-pointerJohn McCall2010-02-101-2/+2
| | | | | | | conversions. Fix an access-control bug where privileges were not considered at intermediate points along the inheritance path. Prepare for friends. llvm-svn: 95775
* No need to canonicalize the type and use dyn_cast. Also, correctly diagnose ↵Anders Carlsson2010-01-221-1/+40
| | | | | | trying to override a function returning an lvalue reference with a function overriding an rvalue reference. llvm-svn: 94183
* Fix an obvious goof that caused us to only see the top level of return typesChandler Carruth2010-01-221-0/+17
| | | | | | | | | when checking for covariance. Added some fun test cases, fixes PR6110. This felt obvious enough to just commit. ;] Let me know if anything needs tweaking. llvm-svn: 94173
* Make sure that an overriding return type is complete before checking if it's ↵Anders Carlsson2009-12-311-0/+47
| | | | | | covariant. Fixes PR5920. llvm-svn: 92365
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Unify the end-of-class code paths used by the parser and templateDouglas Gregor2009-12-031-3/+16
| | | | | | | | | | | | | | instantiation, to ensure that we mark class template specilizations as abstract when we need to and perform checking of abstract classes. Also, move the checking that determines whether we are creating a variable of abstract class type *after* we check whether the type is complete. Otherwise, we won't see when we have an abstract class template specialization that is implicitly instantiated by this declaration. This is the "something else" that Sebastian had noted earlier. llvm-svn: 90467
* Funtion templates and function template specializations do notDouglas Gregor2009-12-011-2/+14
| | | | | | | override virtual functions. Also, eliminate a (now redundant) call to AddOverriddenMethods. llvm-svn: 90242
* Move the checking of overridden virtual functions into the code pathDouglas Gregor2009-12-011-0/+13
| | | | | | | | | | | | | | | common to both parsing and template instantiation, so that we'll find overridden virtuals for member functions of class templates when they are instantiated. Additionally, factor out the checking for pure virtual functions, so that it will be executed both at parsing time and at template instantiation time. These changes fix PR5656 (for real), although one more tweak w.r.t. member function templates will be coming along shortly. llvm-svn: 90241
* An inherited virtual (where "virtual" wasn't written explicitly) canDouglas Gregor2009-12-011-0/+8
| | | | | | be defined as pure. Fixes PR5656. llvm-svn: 90237
* Check that the function being overridden is virtual.Anders Carlsson2009-05-141-0/+13
| | | | llvm-svn: 71802
* Fix the same speling error in the test case (Duh).Anders Carlsson2009-05-141-1/+1
| | | | llvm-svn: 71793
* Better diagnostics for covariance when checking overriding return types.Anders Carlsson2009-05-141-1/+81
| | | | llvm-svn: 71786
* Add return type checking for overriding virtual functions. We currently ↵Anders Carlsson2009-05-141-0/+13
don't check covariance but that's next. llvm-svn: 71759
OpenPOWER on IntegriCloud