Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / PR11358.cpp
blob9c49227695c37aa0e77932b958d92f649d0cdcc9
1 // RUN: %clang_cc1 %s -verify
2 // PR11358
4 namespace test1 {
5 template<typename T>
6 struct container {
7 class iterator {};
8 iterator begin() { return iterator(); }
9 };
11 template<typename T>
12 struct Test {
13 typedef container<T> Container;
14 void test() {
15 Container::iterator i = c.begin(); // expected-error{{missing 'typename'}}
17 Container c;
21 namespace test2 {
22 template <typename Key, typename Value>
23 class hash_map {
24 class const_iterator { void operator++(); };
25 const_iterator begin() const;
26 const_iterator end() const;
29 template <typename KeyType, typename ValueType>
30 void MapTest(hash_map<KeyType, ValueType> map) {
31 for (hash_map<KeyType, ValueType>::const_iterator it = map.begin(); // expected-error{{missing 'typename'}}
32 it != map.end(); it++) {
37 namespace test3 {
38 template<typename T>
39 struct container {
40 class iterator {};
43 template<typename T>
44 struct Test {
45 typedef container<T> Container;
46 void test() {
47 Container::iterator const i; // expected-error{{missing 'typename'}}
49 Container c;