diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-10-22 15:07:22 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-10-22 15:07:22 +0000 |
commit | 5ed66f709126b60e88631bf86d7e2d59e774686f (patch) | |
tree | 333cb676b459a075a748ab552d114c48d6363963 /test/SemaCXX/static-cast.cpp | |
parent | a9e29aa4b1e5042a763240899d8b8cf1267c3ec5 (diff) |
Try to instantiate templates before doing hierarchy checks in static_cast. Fixes PR5261.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84860 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/static-cast.cpp')
-rw-r--r-- | test/SemaCXX/static-cast.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCXX/static-cast.cpp b/test/SemaCXX/static-cast.cpp index 8db8e33b93..d816c05e3e 100644 --- a/test/SemaCXX/static-cast.cpp +++ b/test/SemaCXX/static-cast.cpp @@ -133,3 +133,14 @@ void t_529_9() (void)static_cast<int A::*>((int H::*)0); // expected-error {{ambiguous conversion from pointer to member of derived class 'struct H'}} (void)static_cast<int A::*>((int F::*)0); // expected-error {{conversion from pointer to member of class 'struct F'}} } + +// PR 5261 - static_cast should instantiate template if possible +namespace pr5261 { + struct base {}; + template<typename E> struct derived : public base {}; + template<typename E> struct outer { + base *pb; + ~outer() { (void)static_cast<derived<E>*>(pb); } + }; + outer<int> EntryList; +} |