aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2009-03-18 20:26:44 +0000
committerGabor Greif <ggreif@gmail.com>2009-03-18 20:26:44 +0000
commita88620c0d15d380975eb2c4c9251cd6ff8d2aa64 (patch)
tree0c5d31fd066afd3b8b53e3f0bba58923894afd10
parent0edefebc10fbc627d55d53936fc66178d1c08da1 (diff)
added type dependent testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67230 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/SemaTemplate/instantiate-expr-2.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/SemaTemplate/instantiate-expr-2.cpp b/test/SemaTemplate/instantiate-expr-2.cpp
index 7cfaa9c8ee..b2c43ee76e 100644
--- a/test/SemaTemplate/instantiate-expr-2.cpp
+++ b/test/SemaTemplate/instantiate-expr-2.cpp
@@ -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;
+}
+