From 104a02fb6c96111ce06b53e282adfb2b4a59eeb6 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 29 Jul 2017 21:28:13 +0000 Subject: Vendor import of clang release_50 branch r309439: https://llvm.org/svn/llvm-project/cfe/branches/release_50@309439 --- lib/CodeGen/CodeGenTBAA.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/CodeGen/CodeGenTBAA.cpp') diff --git a/lib/CodeGen/CodeGenTBAA.cpp b/lib/CodeGen/CodeGenTBAA.cpp index 04224e726797..8a75a552d9fa 100644 --- a/lib/CodeGen/CodeGenTBAA.cpp +++ b/lib/CodeGen/CodeGenTBAA.cpp @@ -139,6 +139,12 @@ CodeGenTBAA::getTBAAInfo(QualType QTy) { } } + // C++1z [basic.lval]p10: "If a program attempts to access the stored value of + // an object through a glvalue of other than one of the following types the + // behavior is undefined: [...] a char, unsigned char, or std::byte type." + if (Ty->isStdByteType()) + return MetadataCache[Ty] = getChar(); + // Handle pointers. // TODO: Implement C++'s type "similarity" and consider dis-"similar" // pointers distinct. -- cgit v1.3