[cfe-commits] r67230 - /cfe/trunk/test/SemaTemplate/instantiate-expr-2.cpp
Gabor Greif
ggreif at gmail.com
Wed Mar 18 13:26:44 PDT 2009
Author: ggreif
Date: Wed Mar 18 15:26:44 2009
New Revision: 67230
URL: http://llvm.org/viewvc/llvm-project?rev=67230&view=rev
Log:
added type dependent testcase
Modified:
cfe/trunk/test/SemaTemplate/instantiate-expr-2.cpp
Modified: cfe/trunk/test/SemaTemplate/instantiate-expr-2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-expr-2.cpp?rev=67230&r1=67229&r2=67230&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-expr-2.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-expr-2.cpp Wed Mar 18 15:26:44 2009
@@ -84,9 +84,9 @@
*/
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 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;
+}
+
More information about the cfe-commits
mailing list