blob: f920ef9085b161adac8e210bc63ace86826a8b03 [file] [log] [blame]
Richard Smitha44854a2011-12-20 22:56:20 +00001// 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}