summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/enum-argument.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-06 00:03:12 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-06 00:03:12 +0000
commitb2186fe23c98aa7ac50016374e718f6f475e5c5f (patch)
tree37f5aca72b4824452df15585ff26cee477cf6e95 /clang/test/SemaTemplate/enum-argument.cpp
parent006f9353e15a4506baac3ffcaa3ee27963337bf5 (diff)
downloadbcm5719-llvm-b2186fe23c98aa7ac50016374e718f6f475e5c5f.tar.gz
bcm5719-llvm-b2186fe23c98aa7ac50016374e718f6f475e5c5f.zip
Make sure that EnumConstantDecls always get a type, even when they have type-dependent initializers.
llvm-svn: 86197
Diffstat (limited to 'clang/test/SemaTemplate/enum-argument.cpp')
-rw-r--r--clang/test/SemaTemplate/enum-argument.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/enum-argument.cpp b/clang/test/SemaTemplate/enum-argument.cpp
index 101a1d0cd9d..1d782df202e 100644
--- a/clang/test/SemaTemplate/enum-argument.cpp
+++ b/clang/test/SemaTemplate/enum-argument.cpp
@@ -5,3 +5,19 @@ template <Enum v> struct C {
typedef C<v> Self;
};
template struct C<val>;
+
+template<typename T>
+struct get_size {
+ static const unsigned value = sizeof(T);
+};
+
+template<typename T>
+struct X0 {
+ enum {
+ Val1 = get_size<T>::value,
+ Val2,
+ SumOfValues = Val1 + Val2
+ };
+};
+
+X0<int> x0i;
OpenPOWER on IntegriCloud