summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/offsetof.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-12 07:25:49 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-12 07:25:49 +0000
commit7ca84af48ef9c079eedcabe7fe923fc842ea21ae (patch)
tree74006a4ba90e43ac0c60c58753ed68544ccd5802 /clang/test/SemaCXX/offsetof.cpp
parent9ad6ba37668979d4cc9b6004681241c16bf29d0f (diff)
downloadbcm5719-llvm-7ca84af48ef9c079eedcabe7fe923fc842ea21ae.tar.gz
bcm5719-llvm-7ca84af48ef9c079eedcabe7fe923fc842ea21ae.zip
Suppress warnings and errors about certain uses of non-POD types (in
__builtin_offsetof, passing through an ellipsis) when we're in an unevaluated context. This is the first part of the fix to PR5761, which deals with the simple case of an unevaluated context. llvm-svn: 91210
Diffstat (limited to 'clang/test/SemaCXX/offsetof.cpp')
-rw-r--r--clang/test/SemaCXX/offsetof.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/offsetof.cpp b/clang/test/SemaCXX/offsetof.cpp
index e18987f11ad..bc7a707ee54 100644
--- a/clang/test/SemaCXX/offsetof.cpp
+++ b/clang/test/SemaCXX/offsetof.cpp
@@ -16,3 +16,5 @@ void f() {
struct Base { int x; };
struct Derived : Base { int y; };
int o = __builtin_offsetof(Derived, x); // expected-warning{{offset of on non-POD type}}
+
+const int o2 = sizeof(__builtin_offsetof(Derived, x));
OpenPOWER on IntegriCloud