summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/PR9908.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-05-14 15:04:18 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-05-14 15:04:18 +0000
commit0c4a34b1a089fa5cb675048feec2131d1a6f9150 (patch)
treef31b28fca54fd51cca5f55da834fae01e5398d77 /clang/test/SemaCXX/PR9908.cpp
parent6c4c6a8047f1c0a99dd092227ce06015e471bf17 (diff)
downloadbcm5719-llvm-0c4a34b1a089fa5cb675048feec2131d1a6f9150.tar.gz
bcm5719-llvm-0c4a34b1a089fa5cb675048feec2131d1a6f9150.zip
PR9908: Fix the broken fix for PR9902 to get the template argument lists in the right order.
Also, don't reject alias templates in all ElaboratedTypes: some ElaboratedTypes do not correspond to elaborated-type-specifiers. llvm-svn: 131342
Diffstat (limited to 'clang/test/SemaCXX/PR9908.cpp')
-rw-r--r--clang/test/SemaCXX/PR9908.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/PR9908.cpp b/clang/test/SemaCXX/PR9908.cpp
new file mode 100644
index 00000000000..3b98b724dd8
--- /dev/null
+++ b/clang/test/SemaCXX/PR9908.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
+
+template <class _Tp, class _Up>
+struct __allocator_traits_rebind
+{
+ typedef typename _Tp::template rebind<_Up>::other type;
+};
+
+template <class Alloc>
+struct allocator_traits
+{
+ typedef Alloc allocator_type;
+ template <class T> using rebind_alloc = typename
+__allocator_traits_rebind<allocator_type, T>::type;
+ template <class T> using rebind_traits = allocator_traits<rebind_alloc<T>>;
+};
+
+template <class T>
+struct ReboundA {};
+
+template <class T>
+struct A
+{
+ typedef T value_type;
+
+ template <class U> struct rebind {typedef ReboundA<U> other;};
+};
+
+int main()
+{
+ allocator_traits<A<char> >::rebind_traits<double> a;
+}
OpenPOWER on IntegriCloud