blob: 13ed72f7231e2226efbbade5b01ac345e243674c [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -fsyntax-only -pedantic -verify -std=c++11 %s
Richard Smith3e4c6c42011-05-05 21:57:07 +00002
3template<typename T> using U = int &;
Douglas Gregor898574e2008-12-05 23:32:09 +00004
5template<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 Redl6e824752009-11-05 19:47:47 +00009 T x4[]; // expected-error{{needs an explicit size or an initializer}}
Douglas Gregor898574e2008-12-05 23:32:09 +000010 T x5[Size];
11 int x6[Size];
Richard Smith3e4c6c42011-05-05 21:57:07 +000012 U<T> x7; // expected-error{{declaration of reference variable 'x7' requires an initializer}}
Douglas Gregor898574e2008-12-05 23:32:09 +000013}