Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -pedantic -verify -std=c++11 %s |
Richard Smith | 3e4c6c4 | 2011-05-05 21:57:07 +0000 | [diff] [blame] | 2 | |
| 3 | template<typename T> using U = int &; |
Douglas Gregor | 898574e | 2008-12-05 23:32:09 +0000 | [diff] [blame] | 4 | |
| 5 | template<typename T, int Size> void f() { |
| 6 | T x1; |
| 7 | T* x2; |
| 8 | T& x3; // expected-error{{declaration of reference variable 'x3' requires an initializer}} |
Sebastian Redl | 6e82475 | 2009-11-05 19:47:47 +0000 | [diff] [blame] | 9 | T x4[]; // expected-error{{needs an explicit size or an initializer}} |
Douglas Gregor | 898574e | 2008-12-05 23:32:09 +0000 | [diff] [blame] | 10 | T x5[Size]; |
| 11 | int x6[Size]; |
Richard Smith | 3e4c6c4 | 2011-05-05 21:57:07 +0000 | [diff] [blame] | 12 | U<T> x7; // expected-error{{declaration of reference variable 'x7' requires an initializer}} |
Douglas Gregor | 898574e | 2008-12-05 23:32:09 +0000 | [diff] [blame] | 13 | } |