summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-09 01:55:14 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-09 01:55:14 +0000
commit3d63a9e50157eee3f3d46c831df3323f36083bc7 (patch)
tree532f2b86ab3a1fd48d7841394cc2295e6543750a /clang/test
parent2fc107365bbb3dce455abbbdcf54003f3a56f803 (diff)
downloadbcm5719-llvm-3d63a9e50157eee3f3d46c831df3323f36083bc7.tar.gz
bcm5719-llvm-3d63a9e50157eee3f3d46c831df3323f36083bc7.zip
Make sure to canonicalize the argument type of a non-type template
argument of enumeration type when checking template arguments. Fixes PR10579. llvm-svn: 137101
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaTemplate/temp_arg_nontype.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/temp_arg_nontype.cpp b/clang/test/SemaTemplate/temp_arg_nontype.cpp
index 5be5a130313..f90bb11f716 100644
--- a/clang/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/clang/test/SemaTemplate/temp_arg_nontype.cpp
@@ -263,3 +263,60 @@ namespace PR9227 {
void test_char_single_quote() { enable_if_char<'\''>::type i; } // expected-error{{enable_if_char<'\''>}}
void test_char_backslash() { enable_if_char<'\\'>::type i; } // expected-error{{enable_if_char<'\\'>}}
}
+
+namespace PR10579 {
+ namespace fcppt
+ {
+ namespace container
+ {
+ namespace bitfield
+ {
+
+ template<
+ typename Enum,
+ Enum Size
+ >
+ class basic;
+
+ template<
+ typename Enum,
+ Enum Size
+ >
+ class basic
+ {
+ public:
+ basic()
+ {
+ }
+ };
+
+ }
+ }
+ }
+
+ namespace
+ {
+
+ namespace testenum
+ {
+ enum type
+ {
+ foo,
+ bar,
+ size
+ };
+ }
+
+ }
+
+ int main()
+ {
+ typedef fcppt::container::bitfield::basic<
+ testenum::type,
+ testenum::size
+ > bitfield_foo;
+
+ bitfield_foo obj;
+ }
+
+}
OpenPOWER on IntegriCloud