added type dependent testcase

llvm-svn: 67230
This commit is contained in:
Gabor Greif 2009-03-18 20:26:44 +00:00
parent 68b01a03ba
commit 7b5243a1fc
1 changed files with 19 additions and 2 deletions

View File

@ -84,9 +84,9 @@ namespace N5 {
*/
namespace N6 {
// non-typedependent
template<int I>
struct Lookup {
};
struct Lookup {};
template<bool B, typename T, typename E>
struct Cond {
@ -103,3 +103,20 @@ namespace N6 {
}
namespace N7 {
// type dependent
template<int I>
struct Lookup {};
template<bool B, typename T, typename E>
struct Cond {
T foo() { return B ? T() : E(); }
typedef Lookup<sizeof(B ? T() : E())> Type;
};
//Cond<true, int*, double> C; // Errors
//int V(C.foo()); // Errors
//typedef Cond<true, int*, double>::Type Type; // Errors + CRASHES!
typedef Cond<true, int, double>::Type Type;
}