Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/test/SemaCXX/sugar-common-types.cpp
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++20 -fenable-matrix -triple i686-pc-win32 | // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++20 -x objective-c++ -fobjc-arc -fenable-matrix -triple i686-pc-win32 | ||||
enum class N {}; | enum class N {}; | ||||
using B1 = int; | using B1 = int; | ||||
using X1 = B1; | using X1 = B1; | ||||
using Y1 = B1; | using Y1 = B1; | ||||
using B2 = void; | using B2 = void; | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | |||||
namespace C { using A::type1; }; | namespace C { using A::type1; }; | ||||
using UPX1 = C::type1; | using UPX1 = C::type1; | ||||
namespace A { using type1 = Y1*; }; // redeclared | namespace A { using type1 = Y1*; }; // redeclared | ||||
namespace C { using A::type1; }; // redeclared | namespace C { using A::type1; }; // redeclared | ||||
using UPY1 = C::type1; | using UPY1 = C::type1; | ||||
auto t32 = 0 ? (UPX1){} : (UPY1){}; | auto t32 = 0 ? (UPX1){} : (UPY1){}; | ||||
N t33 = t32; // expected-error {{lvalue of type 'C::type1' (aka 'int *')}} | N t33 = t32; // expected-error {{lvalue of type 'C::type1' (aka 'int *')}} | ||||
N t34 = *t32; // expected-error {{lvalue of type 'B1' (aka 'int')}} | N t34 = *t32; // expected-error {{lvalue of type 'B1' (aka 'int')}} | ||||
// See https://github.com/llvm/llvm-project/issues/61419 | |||||
namespace PR61419 { | |||||
template <class T0, class T1> struct pair { | |||||
T0 first; | |||||
T1 second; | |||||
}; | |||||
extern const pair<id, id> p; | |||||
id t = false ? p.first : p.second; | |||||
} // namespace PR61419 |