| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s |
| 2 |
|
| 3 |
namespace Old { |
| 4 |
template<template<class> class TT> struct X { }; |
| 5 |
template<class> struct Y { }; |
| 6 |
template<class T> using Z = Y<T>; |
| 7 |
X<Y> y; |
| 8 |
X<Z> z; |
| 9 |
|
| 10 |
using SameType = decltype(y); // expected-note {{here}} |
| 11 |
using SameType = decltype(z); // expected-error {{different types}} |
| 12 |
} |
| 13 |
|
| 14 |
namespace New { |
| 15 |
template<class T> struct X { }; |
| 16 |
template<class> struct Y { }; |
| 17 |
template<class T> using Z = Y<T>; |
| 18 |
X<Y<int>> y; |
| 19 |
X<Z<int>> z; |
| 20 |
|
| 21 |
using SameType = decltype(y); |
| 22 |
using SameType = decltype(z); // ok |
| 23 |
} |