-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sema] Prevent binding incompatible addr space ref to temporaries
References to arbitrary address spaces can't always be bound to temporaries. This change extends the reference binding logic to check that the address space of a temporary can be implicitly converted to the address space in a reference when temporary materialization is performed. Differential Revision: https://reviews.llvm.org/D61318 llvm-svn: 362604
- Loading branch information
Anastasia Stulova
committed
Jun 5, 2019
1 parent
22e99c4
commit 5145b1e
Showing
5 changed files
with
41 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -pedantic -verify -fsyntax-only | ||
|
||
__global const int& f(__global float &ref) { | ||
return ref; // expected-error{{reference of type 'const __global int &' cannot bind to a temporary object because of address space mismatch}} | ||
} |