summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/pseudo-destructors.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix handling of class member access into a vector type.Richard Smith2019-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | When handling a member access into a non-class, non-ObjC-object type, we would perform a lookup into the surrounding scope as if for an unqualified lookup. If the member access was followed by a '<' and this lookup (or the typo-correction for it) found a template name, we'd treat the member access as naming that template. Now we treat such accesses as never naming a template if the type of the object expression is of vector type, so that vector component accesses are never misinterpreted as naming something else. This is not entirely correct, since it is in fact valid to name a template from the enclosing scope in this context, when invoking a pseudo-destructor for the vector type via an alias template, but that's very much a corner case, and this change leaves that case only as broken as the corresponding case for Objective-C types is. This incidentally adds support for dr2292, which permits a 'template' keyword at the start of a member access naming a pseudo-destructor. llvm-svn: 368940
* Print nested name specifiers for typedefs and type aliasesAlex Lorenz2017-03-101-1/+1
| | | | | | | | | | | | Printing typedefs or type aliases using clang_getTypeSpelling() is missing the namespace they are defined in. This is in contrast to other types that always yield the full typename including namespaces. Patch by Michael Reiher! Differential Revision: https://reviews.llvm.org/D29944 llvm-svn: 297465
* [Sema] Improve the error diagnostic for dot destructor calls on pointer objectsAlex Lorenz2017-01-201-0/+23
| | | | | | | | | | | | | This commit improves the mismatched destructor type error by detecting when the destructor call has used a '.' instead of a '->' on a pointer to the destructed type. The diagnostic now suggests to use '->' instead of '.', and adds a fixit where appropriate. rdar://28766702 Differential Revision: https://reviews.llvm.org/D25817 llvm-svn: 292615
* Unify warnings/errors from "maybe you meant" to "did you mean".Eric Christopher2015-04-021-1/+1
| | | | llvm-svn: 233981
* Sema: Parenthesized bound destructor member expressions can be calledDavid Majnemer2015-02-251-1/+5
| | | | | | | | | We would wrongfully reject (a.~A)() in both the destructor and pseudo-destructor cases. This fixes PR22668. llvm-svn: 230512
* Per [basic.lookup.classref]p3, in an expression of the form p->~type-name, theRichard Smith2012-11-151-1/+6
| | | | | | | | | | type-name is looked up in the context of the complete postfix-expression. Don't forget to pass the scope into this lookup when the type-name is a template-id; it might name an alias template which can't be found within the class itself. Bug spotted by Johannes Schaub on #llvm. llvm-svn: 168011
* Support decltype in pseudo destructors and dependent destructor calls.David Blaikie2011-12-161-1/+4
| | | | | | Reviewed by Eli Friedman. llvm-svn: 146738
* Don't crash when transforming an ill-formed pseudo-destructorDouglas Gregor2011-11-091-0/+9
| | | | | | expression. Fixes PR11339. llvm-svn: 144159
* When clearing a LookupResult structure, clear out the naming class,Douglas Gregor2011-03-041-4/+3
| | | | | | | | | too. Fixes PR7900. While I'm in this area, improve the diagnostic when the type being destroyed doesn't match either of the types we found. llvm-svn: 127041
* Allow pseudo-destructors to be called on qualified pointers. Patch byJohn McCall2010-06-111-0/+12
| | | | | | Troy Straszheim! llvm-svn: 105823
* ActOnPseudoDestructorExpr now performs all semantic analysis forDouglas Gregor2010-02-241-2/+6
| | | | | | | | | | | | | | | | pseudo-destructor expressions, and builds the CXXPseudoDestructorExpr node directly. Currently, this only affects pseudo-destructor expressions when they are parsed, but not after template instantiation. That's coming next... Improve parsing of pseudo-destructor-names. When parsing the nested-name-specifier and we hit the sequence of tokens X :: ~, query the actual module to determine whether X is a type-name (in which case the X :: is part of the pseudo-destructor-name but not the nested-name-specifier) or not (in which case the X :: is part of the nested-name-specifier). llvm-svn: 97058
* Implement crazy destructor name lookup semantics differently inDouglas Gregor2010-02-231-1/+1
| | | | | | | | | | C++98/03 and C++0x, since the '0x semantics break valid C++98/03 code. This new mess is tracked by core issue 399, which is still unresolved. Fixes PR6358 and PR6359. llvm-svn: 96836
* Implement support for parsing pseudo-destructor expression with a ↵Douglas Gregor2010-02-211-1/+7
| | | | | | | | | | | | nested-name-specifier, e.g., typedef int Int; int *p; p->Int::~Int(); This weakens the invariant that the only types in nested-name-specifiers are tag types (restricted to class types in C++98/03). However, we weaken this invariant as little as possible, accepting arbitrary types in nested-name-specifiers only when we're in a member access expression that looks like a pseudo-destructor expression. llvm-svn: 96743
* Commiting a revert from dgregor of a bit of destructor logic until we canChandler Carruth2010-02-211-1/+1
| | | | | | | figure out how not to break lots of code using this. See PR6358 and PR6359 for motivating examples. FIXME's left in the code and the test. llvm-svn: 96733
* Improve parsing and instantiation of destructor names, so that we canDouglas Gregor2010-02-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | now cope with the destruction of types named as dependent templates, e.g., y->template Y<T>::~Y() Nominally, we implement C++0x [basic.lookup.qual]p6. However, we don't follow the letter of the standard here because that would fail to parse template<typename T, typename U> X0<T, U>::~X0() { } properly. The problem is captured in core issue 339, which gives some (but not enough!) guidance. I expect to revisit this code when the resolution of 339 is clear, and/or we start capturing better source information for DeclarationNames. Fixes PR6152. llvm-svn: 96367
* 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
* Implement C++ [basic.lookup.classref]p3, which states how the typeDouglas Gregor2009-11-201-0/+9
| | | | | | | | | | | | name 'T' is looked up in the expression t.~T() Previously, we weren't looking into the type of "t", and therefore would fail when T actually referred to an injected-class-name. Fixes PR5530. llvm-svn: 89493
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-1/+1
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* If a destructor is referenced or a pseudo-destructor expression isDouglas Gregor2009-09-041-0/+6
| | | | | | | formed without a trailing '(', diagnose the error (these expressions must be immediately called), emit a fix-it hint, and fix the code. llvm-svn: 81015
* Implement AST, semantics, and CodeGen for C++ pseudo-destructorDouglas Gregor2009-09-041-2/+23
| | | | | | | | | | | | | expressions, e.g., p->~T() when p is a pointer to a scalar type. We don't currently diagnose errors when pseudo-destructor expressions are used in any way other than by forming a call. llvm-svn: 81009
* More support for pseudo dtors.Anders Carlsson2009-08-261-0/+13
llvm-svn: 80129
OpenPOWER on IntegriCloud