summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/member-access-expr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Reapply "Fix crash on switch conditions of non-integer types in templates"Elizabeth Andrews2019-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | This patch reapplies commit 759948467ea. Patch was reverted due to a clang-tidy test fail on Windows. The test has been modified. There are no additional code changes. Patch was tested with ninja check-all on Windows and Linux. Summary of code changes: Clang currently crashes for switch statements inside a template when the condition is a non-integer field member because contextual implicit conversion is skipped when parsing the condition. This conversion is however later checked in an assert when the case statement is handled. The conversion is skipped when parsing the condition because the field member is set as type-dependent based on its containing class. This patch sets the type dependency based on the field's type instead. This patch fixes Bug 40982.
* Revert "Reapply "Fix crash on switch conditions of non-integer types in ↵Melanie Blower2019-11-081-1/+1
| | | | | | | templates"" This reverts commit 759948467ea3181615d44d80f74ffeb260180fd0. There were build bot failures in clang-tidy
* Reapply "Fix crash on switch conditions of non-integer types in templates"Melanie Blower2019-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reapplies commit 76945821b9cad3. The first version broke buildbots due to clang-tidy test fails. The fails are because some errors in templates are now diagnosed earlier (does not wait till instantiation). I have modified the tests to add checks for these diagnostics/prevent these diagnostics. There are no additional code changes. Summary of code changes: Clang currently crashes for switch statements inside a template when the condition is a non-integer field member because contextual implicit conversion is skipped when parsing the condition. This conversion is however later checked in an assert when the case statement is handled. The conversion is skipped when parsing the condition because the field member is set as type-dependent based on its containing class. This patch sets the type dependency based on the field's type instead. This patch fixes Bug 40982. Reviewers: rnk, gribozavr2 Patch by: Elizabeth Andrews (eandrews) Differential revision: https://reviews.llvm.org/D69950
* Revert "Fix crash on switch conditions of non-integer types in templates"Dmitri Gribenko2019-08-131-1/+1
| | | | | | This reverts commit r368706. It broke ClangTidy tests. llvm-svn: 368738
* Fix crash on switch conditions of non-integer types in templatesElizabeth Andrews2019-08-131-1/+1
| | | | | | | | | | | | | | | | | | | Clang currently crashes for switch statements inside a template when the condition is a non-integer field. The crash is due to incorrect type-dependency of field. Type-dependency of member expressions is currently set based on the containing class. This patch changes this for 'members of the current instantiation' to set the type dependency based on the member's type instead. A few lit tests started to fail once I applied this patch because errors are now diagnosed earlier (does not wait till instantiation). I've modified these tests in this patch as well. Patch fixes PR#40982 Differential Revision: https://reviews.llvm.org/D61027 llvm-svn: 368706
* Lit C++11 Compatibility Patch #8Charles Li2016-04-141-4/+17
| | | | | | 24 tests have been updated for C++11 compatibility. llvm-svn: 266387
* Clarify the logic for when to build an overloaded binop. In particular,John McCall2010-12-061-0/+15
| | | | | | | | | build one when either of the operands calls itself type-dependent; previously we were building when one of the operand types was dependent, which is not always the same thing and which can lead to unfortunate inconsistencies later. Fixes PR8739. llvm-svn: 120990
* Fix an corner-case assertion introduced by the refactoring in r112258;Douglas Gregor2010-08-301-0/+11
| | | | | | | when we're taking the address of a unresolvable value, it might be an implicit member access. Fixes some Boost.Spirit regressions. llvm-svn: 112487
* Use CXXPseudoDestructorExpr as the stored representation for dependentDouglas Gregor2010-02-251-0/+2
| | | | | | | | | | | | | | | | expressions that look like pseudo-destructors, e.g., p->T::~T() where p has dependent type. At template instantiate time, we determine whether we actually have a pseudo-destructor or a member access, and funnel down to the appropriate routine in Sema. Fixes PR6380. llvm-svn: 97092
* Unresolved implicit member accesses are dependent if the object type is ↵John McCall2009-12-191-0/+14
| | | | | | | | | | dependent. Avoids an assertion arising during object-argument initialization in overload resolution. In theory we can resolve this at definition time if the class hierarchy for the member is fully known. llvm-svn: 91747
* 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
* Make sure to grab CVR qualifiers from the canonical type. ARGH!Douglas Gregor2009-11-051-0/+17
| | | | llvm-svn: 86079
* When a template-id expression refers to a member function template, turn it ↵Douglas Gregor2009-10-221-1/+14
| | | | | | into an (implicit) member access expression. Fixes PR5220 llvm-svn: 84848
* Implement AST, semantics, and CodeGen for C++ pseudo-destructorDouglas Gregor2009-09-041-0/+16
| | | | | | | | | | | | | 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
* Implement tree transformations for DeclarationNames. Among otherDouglas Gregor2009-09-031-0/+13
| | | | | | | | | | | things, this means that we can properly cope with member access expressions such as t->operator T() where T is a template parameter (or other dependent type). llvm-svn: 80957
* Improve template instantiation for member access expressions thatDouglas Gregor2009-09-031-4/+4
| | | | | | | | | involve qualified names, e.g., x->Base::f. We now maintain enough information in the AST to compare the results of the name lookup of "Base" in the scope of the postfix-expression (determined at template definition time) and in the type of the object expression. llvm-svn: 80953
* Add a wicked little test-case that illustrates what we have to dealDouglas Gregor2009-09-021-0/+48
with to properly support member access expressions in templates. This test is XFAIL'd, because we get it completely wrong, but I've made the minimal changes to the representation to at least avoid a crash. llvm-svn: 80856
OpenPOWER on IntegriCloud