1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s 2 3template<typename T, typename U> 4struct pair {}; 5 6template<typename T, typename U> 7struct map { 8 typedef pair<T,U> *iterator; 9 iterator begin(); 10 iterator end(); 11}; 12 13template<typename T, typename U> 14pair<T,U> &tie(T &, U &); 15 16int 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