diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index 21c8bf79152e..684005c4876d 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -5411,9 +5411,7 @@ class ElaboratedType final ElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, QualType CanonType, TagDecl *OwnedTagDecl) : TypeWithKeyword(Keyword, Elaborated, CanonType, - NamedType->getDependence() | - (NNS ? toTypeDependence(NNS->getDependence()) - : TypeDependence::None)), + NamedType->getDependence()), NNS(NNS), NamedType(NamedType) { ElaboratedTypeBits.HasOwnedTagDecl = false; if (OwnedTagDecl) { diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp index 6c8d5687c64a..73c8f17a5d36 100644 --- a/clang/lib/AST/ItaniumMangle.cpp +++ b/clang/lib/AST/ItaniumMangle.cpp @@ -2578,10 +2578,6 @@ void CXXNameMangler::mangleType(QualType T) { if (!TST->isTypeAlias()) break; - // FIXME: We presumably shouldn't strip off ElaboratedTypes with - // instantation-dependent qualifiers. See - // https://github.com/itanium-cxx-abi/cxx-abi/issues/114. - QualType Desugared = T.getSingleStepDesugaredType(Context.getASTContext()); if (Desugared == T) diff --git a/clang/test/CXX/drs/dr15xx.cpp b/clang/test/CXX/drs/dr15xx.cpp index 8bfa29a8b667..478a0d7d00dd 100644 --- a/clang/test/CXX/drs/dr15xx.cpp +++ b/clang/test/CXX/drs/dr15xx.cpp @@ -239,20 +239,6 @@ namespace dr1550 { // dr1550: yes } } -namespace dr1558 { // dr1558: 12 -#if __cplusplus >= 201103L - template using first_of = T; - template first_of f(int); // expected-note {{'int' cannot be used prior to '::'}} - template void f(...) = delete; // expected-note {{deleted}} - - struct X { typedef void type; }; - void test() { - f(0); - f(0); // expected-error {{deleted}} - } -#endif -} - namespace dr1560 { // dr1560: 3.5 void f(bool b, int n) { (b ? throw 0 : n) = (b ? n : throw 0) = 0; diff --git a/clang/test/CodeGenCXX/mangle-template.cpp b/clang/test/CodeGenCXX/mangle-template.cpp index 40688de7e12e..9b5220572c2e 100644 --- a/clang/test/CodeGenCXX/mangle-template.cpp +++ b/clang/test/CodeGenCXX/mangle-template.cpp @@ -342,23 +342,3 @@ namespace fixed_size_parameter_pack { template void f(A::B<0, Ns...>); void g() { f<1, 2>({}); } } - -namespace type_qualifier { - template using int_t = int; - template void f(decltype(int_t() + 1)) {} - // FIXME: This mangling doesn't work: we need to mangle the - // instantiation-dependent 'int_t' operand. - // CHECK: @_ZN14type_qualifier1fIPiEEvDTplcvi_ELi1EE - template void f(int); - - // Note that this template has different constraints but would mangle the - // same: - //template void f(decltype(int_t() + 1)) {} - - struct impl { using type = void; }; - template using alias = impl; - template void g(decltype(alias::type(), 1)) {} - // FIXME: Similarly we need to mangle the `T*` in here. - // CHECK: @_ZN14type_qualifier1gIPiEEvDTcmcvv_ELi1EE - template void g(int); -} diff --git a/clang/test/SemaTemplate/instantiation-dependence.cpp b/clang/test/SemaTemplate/instantiation-dependence.cpp deleted file mode 100644 index 75eb510cb68d..000000000000 --- a/clang/test/SemaTemplate/instantiation-dependence.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// RUN: %clang_cc1 -std=c++2b -verify %s - -// Ensure we substitute into instantiation-dependent but non-dependent -// constructs. The poster-child for this is... -template using void_t = void; - -namespace PR24076 { - template T declval(); - struct s {}; - - template() + 1)>> - void foo(T) {} // expected-note {{invalid operands to binary expression}} - - void f() { - foo(s{}); // expected-error {{no matching function}} - } - - template() + 1)>> // expected-error {{invalid operands to binary expression}} - struct bar {}; - - bar bar; // expected-note {{in instantiation of}} -} - -namespace PR33655 { - struct One { using x = int; }; - struct Two { using y = int; }; - - template * = nullptr> int &func() {} - template * = nullptr> float &func() {} - - int &test1 = func(); - float &test2 = func(); - - template struct indirect_void_t_imp { using type = void; }; - template using indirect_void_t = typename indirect_void_t_imp::type; - - template void foo() { - static_assert(!__is_void(indirect_void_t)); // "ok", dependent - static_assert(!__is_void(void_t)); // expected-error {{failed}} - } -} - -namespace PR46791 { // also PR45782 - template - struct trait { - static constexpr int specialization = 0; - }; - - // FIXME: Per a strict interpretation of the C++ rules, the two void_t<...> - // types below are equivalent -- we only (effectively) do token-by-token - // comparison for *expressions* appearing within types. But all other - // implementations accept this, using rules that are unclear. - template - struct trait> { // expected-note {{previous}} FIXME-note {{matches}} - static constexpr int specialization = 1; - }; - - template - struct trait> { // expected-error {{redefinition}} FIXME-note {{matches}} - static constexpr int specialization = 2; - }; - - struct A {}; - struct B { typedef int value_type; }; - struct C { typedef int element_type; }; - struct D : B, C {}; - - static_assert(trait::specialization == 0); - static_assert(trait::specialization == 1); // FIXME expected-error {{failed}} - static_assert(trait::specialization == 2); // FIXME expected-error {{failed}} - static_assert(trait::specialization == 0); // FIXME-error {{ambiguous partial specialization}} -} diff --git a/clang/test/SemaTemplate/partial-spec-instantiate.cpp b/clang/test/SemaTemplate/partial-spec-instantiate.cpp index 3b7cee88c42e..2fc0517ae3d3 100644 --- a/clang/test/SemaTemplate/partial-spec-instantiate.cpp +++ b/clang/test/SemaTemplate/partial-spec-instantiate.cpp @@ -51,6 +51,8 @@ namespace rdar9169404 { X::type value; #if __cplusplus >= 201103L // expected-error@-2 {{non-type template argument evaluates to -1, which cannot be narrowed to type 'bool'}} +#else + // expected-no-diagnostics #endif } @@ -96,19 +98,3 @@ namespace rdar39524996 { takesWrapperInContainer(c); } } - -namespace InstantiationDependent { - template using ignore = void; // expected-warning 0-1{{extension}} - template struct A { - static const bool specialized = false; - }; - template struct Hide { typedef void type; }; - template struct A >::type> { - static const bool specialized = true; - }; - - struct X {}; - struct Y { typedef int type; }; - _Static_assert(!A::specialized, ""); - _Static_assert(A::specialized, ""); -} diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html index 57093c1cf5b0..f2f711b55094 100755 --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -9162,7 +9162,7 @@ and POD class 1558 CD4 Unused arguments in alias template specializations - Clang 12 + Unknown 1559