[clang] 8aaafa0 - Added remotely ran compiler-rt tests.
Author: Alex Orlov Date: 2020-10-30T00:11:16+04:00 New Revision: 8aaafa06b2afce8d0c7ac062708fd91aae01909f URL: https://github.com/llvm/llvm-project/commit/8aaafa06b2afce8d0c7ac062708fd91aae01909f DIFF: https://github.com/llvm/llvm-project/commit/8aaafa06b2afce8d0c7ac062708fd91aae01909f.diff LOG: Added remotely ran compiler-rt tests. Use LLVM/utils/remote-exec.py to run compiler-rt tests remotely on the target. Reviewed By: vvereschaka Differential Revision: https://reviews.llvm.org/D90054 Added: Modified: clang/cmake/caches/CrossWinToARMLinux.cmake Removed: diff --git a/clang/cmake/caches/CrossWinToARMLinux.cmake b/clang/cmake/caches/CrossWinToARMLinux.cmake index 83d581567020..67d49f4e52ec 100644 --- a/clang/cmake/caches/CrossWinToARMLinux.cmake +++ b/clang/cmake/caches/CrossWinToARMLinux.cmake @@ -71,7 +71,9 @@ set(COMPILER_RT_BUILD_SANITIZERSOFF CACHE BOOL "") set(COMPILER_RT_BUILD_XRAY OFF CACHE BOOL "") set(COMPILER_RT_BUILD_LIBFUZZER OFF CACHE BOOL "") set(COMPILER_RT_BUILD_PROFILE OFF CACHE BOOL "") +set(COMPILER_RT_BUILD_CRT OFF CACHE BOOL "") set(COMPILER_RT_DEFAULT_TARGET_ONLY ON CACHE BOOL "") +set(COMPILER_RT_INCLUDE_TESTS ON CACHE BOOL "") set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") set(LIBUNWIND_TARGET_TRIPLE "${CMAKE_C_COMPILER_TARGET}" CACHE STRING "") @@ -109,6 +111,9 @@ if(DEFINED REMOTE_TEST_HOST) set(DEFAULT_TEST_TARGET_INFO "libcxx.test.target_info.LinuxRemoteTI") # Allow override with the custom values. + if(NOT DEFINED COMPILER_RT_EMULATOR) +set(COMPILER_RT_EMULATOR"\\\"${Python3_EXECUTABLE}\\\" \\\"${LLVM_PROJECT_DIR}/llvm/utils/remote-exec.py\\\" --execdir %%T --exec-pattern='.*\\.c.*\\.tmp.*' --host='${REMOTE_TEST_USER}@${REMOTE_TEST_HOST}'" CACHE STRING "") + endif() if(NOT DEFINED LIBUNWIND_TARGET_INFO) set(LIBUNWIND_TARGET_INFO "${DEFAULT_TEST_TARGET_INFO}" CACHE STRING "") endif() ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] 638dcea - [clang] Implement P0692R1 from C++20 (access checking on specializations and instantiations)
Author: Alex Orlov Date: 2021-08-10T19:20:50+04:00 New Revision: 638dcea010cfc280f428d0cc13f4aa8578a1d69d URL: https://github.com/llvm/llvm-project/commit/638dcea010cfc280f428d0cc13f4aa8578a1d69d DIFF: https://github.com/llvm/llvm-project/commit/638dcea010cfc280f428d0cc13f4aa8578a1d69d.diff LOG: [clang] Implement P0692R1 from C++20 (access checking on specializations and instantiations) This patch implements paper P0692R1 from the C++20 standard. Disable usual access checking rules to template argument names in a declaration of partial specializations, explicit instantiation or explicit specialization (C++20 13.7.5/10, 13.9.1/6). Fixes: https://llvm.org/PR37424 This patch also implements option *A* from this paper P0692R1 from the C++20 standard. This patch follows the @rsmith suggestion from D78404. Reviewed By: krisb Differential Revision: https://reviews.llvm.org/D92024 Added: clang/test/CXX/temp/temp.spec/func.spec.cpp clang/test/CXX/temp/temp.spec/part.spec.cpp Modified: clang/lib/Parse/ParseDecl.cpp clang/lib/Parse/ParseDeclCXX.cpp clang/lib/Parse/ParseTemplate.cpp clang/test/CXX/class.access/class.friend/p1.cpp clang/test/CXX/drs/dr1xx.cpp clang/test/CXX/temp/temp.spec/temp.explicit/p12.cpp Removed: clang/test/CXX/temp/temp.spec/temp.explicit/p11.cpp diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 939323517b4d5..2b19ade185af4 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -3091,6 +3091,12 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, return true; }; +// Turn off usual access checking for template specializations and +// instantiations. +bool IsTemplateSpecOrInst = +(TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation || + TemplateInfo.Kind == ParsedTemplateInfo::ExplicitSpecialization); + switch (Tok.getKind()) { default: DoneWithDeclSpec: @@ -3261,6 +3267,12 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, isConstructorDeclarator(/*Unqualified*/ false)) goto DoneWithDeclSpec; + // C++20 [temp.spec] 13.9/6. + // This disables the access checking rules for function template explicit + // instantiation and explicit specialization: + // - `return type`. + SuppressAccessChecks SAC(*this, IsTemplateSpecOrInst); + ParsedType TypeRep = Actions.getTypeName(*Next.getIdentifierInfo(), Next.getLocation(), getCurScope(), &SS, false, false, nullptr, @@ -3268,6 +3280,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, /*WantNontrivialTypeSourceInfo=*/true, isClassTemplateDeductionContext(DSContext)); + if (IsTemplateSpecOrInst) +SAC.done(); + // If the referenced identifier is not a type, then this declspec is // erroneous: We already checked about that it has no type specifier, and // C++ doesn't have implicit int. Diagnose it as a typo w.r.t. to the @@ -3377,10 +3392,24 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, // In C++, check to see if this is a scope specifier like foo::bar::, if // so handle it as such. This is important for ctor parsing. if (getLangOpts().CPlusPlus) { -if (TryAnnotateCXXScopeToken(EnteringContext)) { +// C++20 [temp.spec] 13.9/6. +// This disables the access checking rules for function template +// explicit instantiation and explicit specialization: +// - `return type`. +SuppressAccessChecks SAC(*this, IsTemplateSpecOrInst); + +const bool Success = TryAnnotateCXXScopeToken(EnteringContext); + +if (IsTemplateSpecOrInst) + SAC.done(); + +if (Success) { + if (IsTemplateSpecOrInst) +SAC.redelay(); DS.SetTypeSpecError(); goto DoneWithDeclSpec; } + if (!Tok.is(tok::identifier)) continue; } diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index bf01099f5f5ce..a4bfb0d6f4e25 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -1474,19 +1474,15 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, return; } - // C++03 [temp.explicit] 14.7.2/8: - // The usual access checking rules do not apply to names used to specify - // explicit instantiations. - // - // As an extension we do not perform access checking on the names used to - // specify explicit specializations either. This is important to allow - // specializing traits classes for private types. - // - // Note that we don't suppress if this turns out to be an elaborated - // type specifier. - bool shouldDelayDiagsInTag = -(TemplateInfo.Kind == ParsedTemplateI
[clang] bc24014 - [c++20] Implement P1185R2 (as modified by P2002R0).
Hi Richard, http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/1353 The bots are broken for a long time now. When do you expect the fix? Thanks, Alex On Wed, Dec 11, 2019 at 12:13 AM Yvan Roux via cfe-commits wrote: Hi Richard, ARM bots are broken after this commit, logs are available here: http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/12109/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Acxx2a-three-way-comparison.cpp Thanks, Yvan On Wed, 11 Dec 2019 at 02:24, Richard Smith via cfe-commits mailto:cfe-commits@lists.llvm.org>> wrote: > > > Author: Richard Smith > Date: 2019-12-10T17:24:27-08:00 > New Revision: bc24014b9765a454cb5214f4871451a41ffb7d29 > > URL: > https://github.com/llvm/llvm-project/commit/bc24014b9765a454cb5214f4871451a41ffb7d29 > DIFF: > https://github.com/llvm/llvm-project/commit/bc24014b9765a454cb5214f4871451a41ffb7d29.diff > > LOG: [c++20] Implement P1185R2 (as modified by P2002R0). > > For each defaulted operator<=> in a class that doesn't explicitly > declare any operator==, also inject a matching implicit defaulted > operator==. > > Added: > clang/test/CXX/class/class.compare/class.compare.default/p4.cpp > > Modified: > clang/include/clang/Basic/DiagnosticSemaKinds.td > clang/include/clang/Sema/Sema.h > clang/include/clang/Sema/Template.h > clang/lib/Frontend/FrontendActions.cpp > clang/lib/Sema/SemaDeclCXX.cpp > clang/lib/Sema/SemaOverload.cpp > clang/lib/Sema/SemaTemplateInstantiate.cpp > clang/lib/Sema/SemaTemplateInstantiateDecl.cpp > clang/test/CodeGenCXX/cxx2a-three-way-comparison.cpp > > Removed: > > > > > diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td > b/clang/include/clang/Basic/DiagnosticSemaKinds.td > index aeeff2b9a76e..a5f35996cfdc 100644 > --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td > +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td > @@ -3840,6 +3840,7 @@ def select_ovl_candidate_kind : TextSubstitution< > "constructor (the implicit move constructor)|" > "function (the implicit copy assignment operator)|" > "function (the implicit move assignment operator)|" > +"function (the implicit 'operator==' for this 'operator<=>)'|" > "inherited constructor}0%select{| template| %2}1">; > > def note_ovl_candidate : Note< > @@ -8207,7 +8208,8 @@ def warn_defaulted_comparison_deleted : Warning< >"explicitly defaulted %sub{select_defaulted_comparison_kind}0 is > implicitly " >"deleted">, InGroup; > def err_non_first_default_compare_deletes : Error< > - "defaulting this %sub{select_defaulted_comparison_kind}0 " > + "defaulting %select{this %sub{select_defaulted_comparison_kind}1|" > + "the corresponding implicit 'operator==' for this defaulted > 'operator<=>'}0 " >"would delete it after its first declaration">; > def note_defaulted_comparison_union : Note< >"defaulted %0 is implicitly deleted because " > @@ -8237,14 +8239,19 @@ def note_defaulted_comparison_cannot_deduce : Note< > def note_defaulted_comparison_cannot_deduce_callee : Note< >"selected 'operator<=>' for %select{|member|base class}0 %1 declared > here">; > def err_incorrect_defaulted_comparison_constexpr : Error< > - "defaulted definition of %sub{select_defaulted_comparison_kind}0 " > - "cannot be declared %select{constexpr|consteval}1 because it invokes " > - "a non-constexpr comparison function">; > + "defaulted definition of %select{%sub{select_defaulted_comparison_kind}1|" > + "three-way comparison operator}0 " > + "cannot be declared %select{constexpr|consteval}2 because " > + "%select{it|the corresponding implicit 'operator=='}0 " > + "invokes a non-constexpr comparison function">; > def note_defaulted_comparison_not_constexpr : Note< >"non-constexpr comparison function would be used to compare " >"%select{|member %1|base class %1}0">; > def note_defaulted_comparison_not_constexpr_here : Note< >"non-constexpr comparison function declared here">; > +def note_in_declaration_of_implicit_equality_comparison : Note< > + "while declaring the corresponding implicit 'operator==' " > + "for this defaulted 'operator<=>'">; > > def ext_implicit_exception_spec_mismatch : ExtWarn< >"function previously declared with an %select{explicit|implicit}0 > exception " > > diff --git a/clang/include/clang/Sema/Sema.h > b/clang/include/clang/Sema/Sema.h > index 1cdaab3dc28c..5a1ee507218c 100644 > --- a/clang/include/clang/Sema/Sema.h > +++ b/clang/include/clang/Sema/Sema.h > @@ -6524,6 +6524,8 @@ class Sema final { > >bool CheckExplicitlyDefaultedComparison(Scope *S, FunctionDecl *MD, >DefaultedComparisonKind DCK); > + void DeclareImplicitEqualityComparison(CXXRecordDecl *RD, > + FunctionDecl *Spaceship); >void DefineDefaultedComparison(SourceLocation Loc, Funct