aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/class.derived
AgeCommit message (Collapse)Author
2012-11-22Fix CXXRecordDecl::forallBases to not look through bases which are dependentRichard Smith
and defined within the current instantiation, but which are not part of the current instantiation. Previously, it would look at bases which could be specialized separately from the current template. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168477 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs
VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166280 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17Implement C++ 10.3p16 - overrides involving deleted functions must match.David Blaikie
Only deleted functions may override deleted functions and non-deleted functions may only override non-deleted functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166082 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-06PR13499: Don't try to check whether 'override' has been validly applied untilRichard Smith
we know whether the function is virtual. But check it as soon as we do know; in some cases we don't need to wait for an instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161316 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15Modify how the -verify flag works. Currently, the verification string andRichard Trieu
diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25Handle redundant 'typename' on base class specifications.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142937 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25Fix erroneous name-specifiers prior to decltypes better/correctly as per ↵David Blaikie
Doug's feedback. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142935 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25Fix cases where the optional nested-name-specifier erroneously preceeded a ↵David Blaikie
decltype-specification when specifying a base type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142928 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25Support the use of decltype for specifying base types. Fixes PR11216.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith
-std=c++0x. Patch by Ahmed Charles! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141900 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-25Get rid of handling of the 'explicit' keyword from class-head. We still ↵Anders Carlsson
parse it though, although that will change shortly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128277 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18Fix PR8767, improve diagnostic wording when allocating an object of anChandler Carruth
abstract class type. Patch by Stephen Hines, with a wording tweak from Doug applied by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125996 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-22Implement [class.derived]p8.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20Diagnose when a virtual member function marked final is overridden.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123916 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20When instantiating member functions, propagate whether the member function ↵Anders Carlsson
is marked 'final' and 'override'. Also, call CheckOverrideControl when instantiating member functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123900 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20When checking for functions marked override, ignore dependent contexts.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123894 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20Diagnose virtual member functions marked override but not overriding any ↵Anders Carlsson
virtual member functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22In the presence of using declarations, we can find the same classDouglas Gregor
members in class subobjects of different types. So long as the underlying declaration sets are the same, and the declaration sets involve non-instance members, this is not an ambiguity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23Implement computation of the final overriders for each virtualDouglas Gregor
function within a class hierarchy (C++ [class.virtual]p2). We use the final-overrider computation to determine when a particular class is ill-formed because it has multiple final overriders for a given virtual function (e.g., because two virtual functions override the same virtual function in the same virtual base class). Fixes PR5973. We also use the final-overrider computation to determine which virtual member functions are pure when determining whether a class is abstract or diagnosing the improper use of an abstract class. The prior approach to determining whether there were any pure virtual functions in a class didn't cope with virtual base class subobjects properly, and could not easily be fixed to deal with the oddities of subobject hiding. Fixes PR6631. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03Reinstate r97674 with a fix for the assertion that was firing in <list>Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03Revert r97674; it's causing failuresDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97677 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03Implement disambiguation of base class members via aDouglas Gregor
nested-name-specifier. For example, this allows member access in diamond-shaped hierarchies like: struct Base { void Foo(); int Member; }; struct D1 : public Base {}; struct D2 : public Base {}; struct Derived : public D1, public D2 { } void Test(Derived d) { d.Member = 17; // error: ambiguous cast from Derived to Base d.D1::Member = 17; // error: okay, modify D1's Base's Member } Fixes PR5820 and <rdar://problem/7535045>. Also, eliminate some redundancy between Sema::PerformObjectMemberConversion() and Sema::PerformObjectArgumentInitialization() -- the latter now calls the former. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97674 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03Implement name hiding for names found through virtual base subobjectsDouglas Gregor
that are hidden by other derived base subobjects reached along a lookup path that does *not* pass through the hiding subobject (C++ [class.member.lookup]p6). Fixes PR6462. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Fix for PR5840: fix the kind of name lookup used for classes inEli Friedman
Sema::getTypeName. "LookupNestedNameSpecifierName" isn't quite the right kind of lookup, though; it doesn't ignore namespaces. Someone more familiar with the lookup code should fix this properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar
- 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26When a member reference expression includes a qualifier on the memberDouglas Gregor
name, e.g., x->Base::f() retain the qualifier (and its source range information) in a new subclass of MemberExpr called CXXQualifiedMemberExpr. Provide construction, transformation, profiling, printing, etc., for this new expression type. When a virtual function is called via a qualified name, don't emit a virtual call. Instead, call that function directly. Mike, could you add a CodeGen test for this, too? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80167 91177308-0d34-0410-b5e6-96231b3b80d8