llvm-project/clang/test
Yaxun Liu 99a9f75948 Sema: Fix explicit address space cast in C++
Currently clang does not allow implicit cast of a pointer to a pointer type
in different address space but allows C-style cast of a pointer to a pointer
type in different address space. However, there is a bug in Sema causing
incorrect Cast Expr in AST for the latter case, which in turn results in
invalid LLVM IR in codegen.

This is because Sema::IsQualificationConversion returns true for a cast of
pointer to a pointer type in different address space, which in turn allows
a standard conversion and results in a cast expression with no op in AST.

This patch fixes that by let Sema::IsQualificationConversion returns false
for a cast of pointer to a pointer type in different address space, which
in turn disallows standard conversion, implicit cast, and static cast.
Finally it results in an reinterpret cast and correct conversion kind is set.

Differential Revision: https://reviews.llvm.org/D49294

llvm-svn: 337540
2018-07-20 11:32:51 +00:00
..
ARCMT [ObjC] Allow declaring __strong pointer fields in structs in Objective-C 2018-02-28 07:15:55 +00:00
ASTMerge [ASTImporter] Added import of CXXStdInitializerListExpr 2018-06-29 12:17:34 +00:00
Analysis [CStringSyntaxChecker] Check strlcpy sizeof syntax 2018-07-19 21:50:03 +00:00
CXX [Sema] Diagnose an invalid dependent function template specialization 2018-07-19 20:40:20 +00:00
CodeCompletion [CodeComplete] Add a few extra tests for r333538. NFC 2018-06-01 09:49:53 +00:00
CodeGen Fix typo causing assert in self-host. 2018-07-19 23:24:41 +00:00
CodeGenCUDA [FileCheck] Add -allow-deprecated-dag-overlap to failing clang tests 2018-07-11 20:26:20 +00:00
CodeGenCXX Sema: Fix explicit address space cast in C++ 2018-07-20 11:32:51 +00:00
CodeGenCoroutines [Coroutines] Less IR for noexcept await_resume 2018-06-23 18:57:26 +00:00
CodeGenObjC [FileCheck] Add -allow-deprecated-dag-overlap to failing clang tests 2018-07-11 20:26:20 +00:00
CodeGenObjCXX [CodeGen] Always use MSVC personality for windows-msvc targets 2018-06-08 00:41:01 +00:00
CodeGenOpenCL CodeGen: specify alignment + inbounds for automatic variable initialization 2018-07-13 20:33:23 +00:00
Coverage Reapply "[Parse] Use CapturedStmt for @finally on MSVC" 2018-06-08 00:30:00 +00:00
CoverageMapping [Coverage] Remove a test dependency on the itanium ABI 2018-06-01 17:11:18 +00:00
Driver [clang]: Add support for "-fno-delete-null-pointer-checks" 2018-07-19 00:44:52 +00:00
FixIt [Sema] Add fixit for unused lambda captures 2018-07-16 07:23:47 +00:00
Format
Frontend [Fixed Point Arithmetic] Fix for bug where integer literals could be treated as fixed point literals 2018-07-17 14:58:49 +00:00
Headers Add a test to verify the x86 intrinsic headers compile cleanly with no warnings or errors. 2018-06-20 01:05:09 +00:00
Import [ASTImporter] fix test failure corrected by fixed func end locs 2018-07-09 09:02:53 +00:00
Index [Index] Set OrigD before D is changed. 2018-07-20 08:08:56 +00:00
Integration
Layout NFC - Fix typo in test/Layout/itanium-pack-and-align.cpp 2018-07-04 11:21:44 +00:00
Lexer [Driver] Add -fno-digraphs 2018-07-17 04:56:22 +00:00
Misc [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it 2018-07-09 19:00:16 +00:00
Modules [PCH+Modules] Load -fmodule-map-file content before including PCHs 2018-07-19 12:32:06 +00:00
OpenMP The patch adds support for the new map interface between clang and libomptarget. The changes in the interface are the following: 2018-07-19 16:34:13 +00:00
PCH Add PCH tests for R336379 2018-07-05 17:23:15 +00:00
Parser [Parse] Make -Wgcc-compat complain about for loop inits in C89 2018-06-28 21:36:00 +00:00
Preprocessor By popular demand, switch in64_t on NetBSD/AArch64 and NetBSD/PowerPC64 2018-07-17 12:33:19 +00:00
Profile [FileCheck] Add -allow-deprecated-dag-overlap to failing clang tests 2018-07-11 20:26:20 +00:00
Refactor
Rewriter Reapply "[Parse] Use CapturedStmt for @finally on MSVC" 2018-06-08 00:30:00 +00:00
Sema [Sema] Add a new warning, -Wmemset-transposed-args 2018-07-19 16:46:15 +00:00
SemaCUDA [CUDA][HIP] Allow CUDA __global__ functions to have amdgpu kernel attributes 2018-06-12 23:58:59 +00:00
SemaCXX Enable C++2a Chrono Literals 2018-07-19 13:36:57 +00:00
SemaObjC [Sema] Emit -Wincomplete-implementation for partial methods. 2018-07-07 01:50:20 +00:00
SemaObjCXX [Sema] Produce diagnostics for attribute 'trivial_abi' that appears 2018-06-19 05:04:44 +00:00
SemaOpenCL DR1687: When overload resolution selects a built-in operator, implicit 2018-06-27 20:30:34 +00:00
SemaOpenCLCXX [OpenCL] Support new/delete in Sema 2018-06-14 09:51:54 +00:00
SemaTemplate Fix failing testcase to actually be valid. 2018-07-19 19:05:13 +00:00
TableGen [Clang Tablegen][RFC] Allow Early Textual Substitutions in `Diagnostic` messages. 2018-05-19 03:12:04 +00:00
Templight [Templight] Template Instantiation Observer 2018-02-10 14:04:45 +00:00
Tooling Fix test clang-diff-json.cpp 2018-02-10 21:28:55 +00:00
Unit
VFS [Modules][ObjC] Warn on the use of '@import' in framework headers 2018-06-27 20:29:36 +00:00
clang-rename
.clang-format
CMakeLists.txt Support for multiarch runtimes layout 2018-06-28 03:11:52 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg.py Reinstate quotes around the path to python that I accidentaly removed in r335330 2018-06-22 20:03:32 +00:00
lit.site.cfg.py.in Remove unused lit setting, see https://reviews.llvm.org/D46619 2018-05-09 12:38:51 +00:00
make_test_dirs.pl