summaryrefslogtreecommitdiffstats
path: root/clang
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
commit7b5243a1fc6929d39713b2a5fe32152f7bb50925 (patch)
tree90a0e5bfeb0c91363c81bf2a60117eab08f266c5 /clang
parent68b01a03ba722f2a52f489092c3c00644b52df98 (diff)
downloadbcm5719-llvm-7b5243a1fc6929d39713b2a5fe32152f7bb50925.tar.gz
bcm5719-llvm-7b5243a1fc6929d39713b2a5fe32152f7bb50925.zip
added type dependent testcase
llvm-svn: 67230
Diffstat (limited to 'clang')
-rw-r--r--clang/test/SemaTemplate/instantiate-expr-2.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/clang/test/SemaTemplate/instantiate-expr-2.cpp b/clang/test/SemaTemplate/instantiate-expr-2.cpp
index 7cfaa9c8ee4..b2c43ee76e0 100644
--- a/clang/test/SemaTemplate/instantiate-expr-2.cpp
+++ b/clang/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;
+}
+
OpenPOWER on IntegriCloud