summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-member-expr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Unrevert r166268, reverted in r166272, with a fix for the issue which NickRichard Smith2012-10-211-1/+16
| | | | | | | | | | | | | | | | | | | | | found: if an overloaded operator& is present before a template definition, the expression &T::foo is represented as a CXXOperatorCallExpr, not as a UnaryOperator, so we didn't notice that it's permitted to reference a non-static data member of an unrelated class. While investigating this, I discovered another problem in this area: we are treating template default arguments as unevaluated contexts during substitution, resulting in performing incorrect checks for uses of non-static data members in C++11. That is not fixed by this patch (I'll look into this soon; it's related to the failure to correctly instantiate constexpr function templates), but was resulting in this bug not firing in C++11 mode (except with -Wc++98-compat). Original message: PR14124: When performing template instantiation of a qualified-id outside of a class, diagnose if the qualified-id instantiates to a non-static class member. llvm-svn: 166385
* Revert r166268, this fix for a crash-on-invalid introduced a rejects-valid.Nick Lewycky2012-10-191-8/+0
| | | | | | Richard has an unreduced testcase to work with. llvm-svn: 166272
* PR14124: When performing template instantiation of a qualified-id outside of aRichard Smith2012-10-191-0/+8
| | | | | | class, diagnose if the qualified-id instantiates to a non-static class member. llvm-svn: 166268
* 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
* [analyzer] Refactoring: Drop the 'GR' prefix.Argyrios Kyrtzidis2010-12-221-3/+3
| | | | llvm-svn: 122424
* Replace one hack with a different hack: strip out the ObjectTypeJohn McCall2010-11-121-0/+17
| | | | | | | | | parameters to the Transform*Type functions and instead call out the specific cases where an object type and the unqualified lookup results are important. Fixes an assert and failed compile on a testcase from PR7248. llvm-svn: 118887
* Improve the diagnostic you get when making a qualified member accessJohn McCall2010-04-271-1/+1
| | | | | | with a qualifier referencing a different type. llvm-svn: 102409
* Make the InjectedClassNameType the canonical type of the current instantiationJohn McCall2010-04-271-1/+1
| | | | | | | | | | | | | | | | of a class template or class template partial specialization. That is to say, in template <class T> class A { ... }; or template <class T> class B<const T*> { ... }; make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType when written inside the appropriate context. This allows us to track the current instantiation appropriately even inside AST routines. It also allows us to compute a DeclContext for a type much more efficiently, at some extra cost every time we write a template specialization (which can be optimized, but I've left it simple in this patch). llvm-svn: 102407
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-3/+3
| | | | | | | | | | 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
* Don't repeat lookup when instantiating resolved member expressions.John McCall2010-01-151-0/+24
| | | | | | | | | | Adjust BuildMemberReferenceExpr to perform the inheritance check on implicit member accesses, which can arise from unqualified lookups and therefore may reference decls from enclosing class scopes. Fixes PR 5838. llvm-svn: 93510
* When we simply return a retained member expression when instantiating, we ↵Anders Carlsson2009-12-221-0/+27
must also mark the member decl as referenced. llvm-svn: 91887
OpenPOWER on IntegriCloud