Richard Smith | 6f1daa4 | 2016-12-16 00:58:48 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++1z -verify %s |
| 2 | |
| 3 | namespace A { |
| 4 | int m, n; |
| 5 | }; |
| 6 | |
| 7 | namespace B { |
| 8 | using A::m, A::n, A::n; |
| 9 | int q = m + n; |
| 10 | } |
| 11 | |
| 12 | struct X { |
Richard Smith | 151c456 | 2016-12-20 21:35:28 +0000 | [diff] [blame] | 13 | int x1, x2, y, z; // expected-note 2{{conflicting}} |
Richard Smith | 6f1daa4 | 2016-12-16 00:58:48 +0000 | [diff] [blame] | 14 | }; |
| 15 | struct Y { |
Richard Smith | 151c456 | 2016-12-20 21:35:28 +0000 | [diff] [blame] | 16 | int x1, x2, y, z; // expected-note 2{{target}} |
Richard Smith | 6f1daa4 | 2016-12-16 00:58:48 +0000 | [diff] [blame] | 17 | }; |
| 18 | struct Z : X, Y { |
| 19 | using X::x1, |
| 20 | blah::blah, // expected-error {{undeclared}} |
| 21 | X::x2, // expected-note {{previous}} |
| 22 | Y::y, |
| 23 | X::x2, // expected-error {{redeclaration}} |
| 24 | X::z, |
| 25 | Y::z; // expected-error {{conflicts with}} |
| 26 | }; |
| 27 | int X::*px1 = &Z::x1; |
| 28 | int X::*px2 = &Z::x2; |
| 29 | int Y::*py = &Z::y; |
| 30 | int X::*pz = &Z::z; |
Richard Smith | 151c456 | 2016-12-20 21:35:28 +0000 | [diff] [blame] | 31 | |
| 32 | template<typename ...T> struct Q : T... { |
| 33 | using T::z...; // expected-error {{conflicts}} |
| 34 | }; |
| 35 | Q<X,Y> q; // expected-note {{instantiation of}} |