Skip to content

Commit 0061488

Browse files
committed
Merge remote-tracking branch 'upstream/sycl' into sycl
2 parents 7db9bff + 80b63a2 commit 0061488

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.github/workflows/sycl-post-commit.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ on:
2020
- ./devops/actions/cached_checkout
2121

2222
concurrency:
23-
# Cancel a currently running workflow from the same PR or commit hash.
24-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
23+
# Cancel a currently running workflow from the same PR or commit hash.
24+
# We need to use the user's branch name (which is in different variables
25+
# for pull request events and push events) so that making a PR from a
26+
# sycl-devops-pr branch doesn't cause two postcommit runs.
27+
group: "${{ github.actor }}-${{ github.head_ref || github.ref_name }}"
2528
cancel-in-progress: true
2629

2730
permissions: read-all

clang/lib/Sema/SemaAccess.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ static AccessResult IsDerivedFromInclusive(const CXXRecordDecl *Derived,
301301
const CXXRecordDecl *Target) {
302302
assert(Derived->getCanonicalDecl() == Derived);
303303
assert(Target->getCanonicalDecl() == Target);
304+
assert(Derived->getDefinition() && "Expecting a complete type");
304305

305306
if (Derived == Target) return AR_accessible;
306307

@@ -776,6 +777,8 @@ static AccessResult HasAccess(Sema &S,
776777
// [B3] and [M3]
777778
} else {
778779
assert(Access == AS_protected);
780+
if (!ECRecord->getDefinition())
781+
continue;
779782
switch (IsDerivedFromInclusive(ECRecord, NamingClass)) {
780783
case AR_accessible: break;
781784
case AR_inaccessible: continue;

clang/test/SemaSYCL/attr-add-ir-attributes.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,3 +991,16 @@ struct __attribute__((sycl_special_class)) InvalidSpecialClassStruct32 {
991991
struct [[__sycl_detail__::add_ir_attributes_kernel_parameter("Attr1", 1)]] InvalidKernelParameterSubjectStruct; // expected-error {{'add_ir_attributes_kernel_parameter' attribute only applies to parameters}}
992992
[[__sycl_detail__::add_ir_attributes_kernel_parameter("Attr1", 1)]] void InvalidKernelParameterSubjectFunction() {} // expected-error {{'add_ir_attributes_kernel_parameter' attribute only applies to parameters}}
993993
[[__sycl_detail__::add_ir_attributes_kernel_parameter("Attr1", 1)]] int InvalidKernelParameterSubjectVar; // expected-error {{'add_ir_attributes_kernel_parameter' attribute only applies to parameters}}
994+
995+
struct A {
996+
protected:
997+
static constexpr const char *ir_attribute_name = ""; // expected-note {{declared protected here}}
998+
static constexpr auto ir_attribute_value = nullptr; // expected-note {{declared protected here}}
999+
};
1000+
1001+
template <typename Ts>
1002+
struct [[__sycl_detail__::add_ir_attributes_global_variable(
1003+
Ts::ir_attribute_name, Ts::ir_attribute_value)]] B { // expected-error {{'ir_attribute_name' is a protected member of 'A'}} // expected-error {{'ir_attribute_value' is a protected member of 'A'}}
1004+
};
1005+
1006+
B<A> v; // expected-note {{in instantiation of template class 'B<A>' requested here}}

0 commit comments

Comments
 (0)