1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2 
3 template<typename T, typename U>
4 struct pair {};
5 
6 template<typename T, typename U>
7 struct map {
8   typedef pair<T,U> *iterator;
9   iterator begin();
10   iterator end();
11 };
12 
13 template<typename T, typename U>
14 pair<T,U> &tie(T &, U &);
15 
16 int foo(map<char*,int> &m) {
17   char *p;
18   int n;
19 
20   for (pair<char*,int> x : m) {
21     (void)x;
22   }
23 
24   for (tie(p, n) : m) { // expected-error {{for range declaration must declare a variable}}
25     (void)p;
26     (void)n;
27   }
28 
29   return n;
30 }
31