aboutsummaryrefslogtreecommitdiff
path: root/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
commit4912c347ce83e908c8a1a585260a32072eaf4ec6 (patch)
treedb02270e03cd5e0e56b17d12eaf018dc86c42d7e /test/SemaTemplate/enum-argument.cpp
parent1fbf1f0052d6758774e565039ba69780295eb8dd (diff)
Make sure that EnumConstantDecls always get a type, even when they have type-dependent initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86197 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/enum-argument.cpp')
-rw-r--r--test/SemaTemplate/enum-argument.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaTemplate/enum-argument.cpp b/test/SemaTemplate/enum-argument.cpp
index 101a1d0cd9..1d782df202 100644
--- a/test/SemaTemplate/enum-argument.cpp
+++ b/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;