diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-17 19:05:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-17 19:05:46 +0000 |
commit | 879fd49f99742e61965f7fefecf1f3b4ba90e197 (patch) | |
tree | 94f7603c0ae78bc3bcf9eda2701b44f9405d226c /test/SemaTemplate/instantiate-enum.cpp | |
parent | 1fd6c4b8abbbdcbae0e221f35100102112dabff2 (diff) |
Implement instantiation of enums within class templates. This isn't
quite as great as it sounds, because, while we can refer to the
enumerator values outside the template, e.g.,
adder<long, 3, 4>::value
we can't yet refer to them with dependent names, so no Fibonacci
(yet).
InstantiateClassTemplateSpecialization is getting messy; next commit
will put it into a less-ugly state.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-enum.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-enum.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-enum.cpp b/test/SemaTemplate/instantiate-enum.cpp new file mode 100644 index 0000000000..665746cfd4 --- /dev/null +++ b/test/SemaTemplate/instantiate-enum.cpp @@ -0,0 +1,11 @@ +// RUN: clang -fsyntax-only %s + +template<typename T, T I, int J> +struct adder { + enum { + value = I + J, + value2 + }; +}; + +int array1[adder<long, 3, 4>::value == 7? 1 : -1]; |