aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-member-expr.cpp
AgeCommit message (Collapse)Author
2012-10-21Unrevert r166268, reverted in r166272, with a fix for the issue which NickRichard Smith
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166385 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19Revert r166268, this fix for a crash-on-invalid introduced a rejects-valid.Nick Lewycky
Richard has an unreduced testcase to work with. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166272 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19PR14124: When performing template instantiation of a qualified-id outside of aRichard Smith
class, diagnose if the qualified-id instantiates to a non-static class member. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166268 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-04Enhance the diagnostic for negative array sizes to include theChandler Carruth
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22[analyzer] Refactoring: Drop the 'GR' prefix.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122424 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12Replace one hack with a different hack: strip out the ObjectTypeJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-27Improve the diagnostic you get when making a qualified member accessJohn McCall
with a qualifier referencing a different type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-27Make the InjectedClassNameType the canonical type of the current instantiationJohn McCall
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102407 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10When pretty-printing tag types, only print the tag if we're in C (andJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15Don't repeat lookup when instantiating resolved member expressions.John McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22When we simply return a retained member expression when instantiating, we ↵Anders Carlsson
must also mark the member decl as referenced. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91887 91177308-0d34-0410-b5e6-96231b3b80d8