llvm-project
35 строк · 754.0 Байт
1// RUN: %clang_cc1 -std=c++1z -verify %s
2
3namespace A {4int m, n;5};6
7namespace B {8using A::m, A::n, A::n;9int q = m + n;10}
11
12struct X {13int x1, x2, y, z; // expected-note 2{{conflicting}}14};15struct Y {16int x1, x2, y, z; // expected-note 2{{target}}17};18struct Z : X, Y {19using X::x1,20blah::blah, // expected-error {{undeclared}}21X::x2, // expected-note {{previous}}22Y::y,23X::x2, // expected-error {{redeclaration}}24X::z,25Y::z; // expected-error {{conflicts with}}26};27int X::*px1 = &Z::x1;28int X::*px2 = &Z::x2;29int Y::*py = &Z::y;30int X::*pz = &Z::z;31
32template<typename ...T> struct Q : T... {33using T::z...; // expected-error {{conflicts}}34};35Q<X,Y> q; // expected-note {{instantiation of}}36