forked from OSchip/llvm-project
parent
68b01a03ba
commit
7b5243a1fc
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue