aboutsummaryrefslogtreecommitdiff
path: root/clang/test/AST/ByteCode
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-05-20 12:36:18 +0200
committerGitHub <noreply@github.com>2025-05-20 12:36:18 +0200
commit67440f0b836268b5741e2d047044339122c37748 (patch)
treedc0c3cff22549c0aab9ea23419aaa3092667d0c1 /clang/test/AST/ByteCode
parentf62c379f71b12e23b80e4f1bfa07900f8469050d (diff)
downloadllvm-67440f0b836268b5741e2d047044339122c37748.zip
llvm-67440f0b836268b5741e2d047044339122c37748.tar.gz
llvm-67440f0b836268b5741e2d047044339122c37748.tar.bz2
[clang][bytecode] Diagnose comparisons of unrelated zero-sized pointers (#140695)
Diffstat (limited to 'clang/test/AST/ByteCode')
-rw-r--r--clang/test/AST/ByteCode/cxx11.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/cxx11.cpp b/clang/test/AST/ByteCode/cxx11.cpp
index 2a1bda6..3682211 100644
--- a/clang/test/AST/ByteCode/cxx11.cpp
+++ b/clang/test/AST/ByteCode/cxx11.cpp
@@ -243,3 +243,10 @@ namespace Volatile {
// both-note {{in call to 'f(0)'}}
};
}
+
+namespace ZeroSizeCmp {
+ extern void (*start[])();
+ extern void (*end[])();
+ static_assert(&start != &end, ""); // both-error {{constant expression}} \
+ // both-note {{comparison of pointers '&start' and '&end' to unrelated zero-sized objects}}
+}