diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2017-11-21 19:25:38 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2017-11-21 19:25:38 +0000 |
commit | 52a3ca9e290925b5900c3176db455b70fdd51529 (patch) | |
tree | c0b0467017558712fcb07618237554799cdad3e3 /clang/test | |
parent | 58166b13e093a8f4eda9ee6bd36e733bd133b62f (diff) | |
download | bcm5719-llvm-52a3ca9e290925b5900c3176db455b70fdd51529.tar.gz bcm5719-llvm-52a3ca9e290925b5900c3176db455b70fdd51529.zip |
The offsetof macro is intended to work with subobjects rather than simple identifiers designating a member, making the -Wextended-offsetof diagnostic obsolete as this construct is not an extension. Implements WG14 DR496.
llvm-svn: 318796
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CXX/drs/dr4xx.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/CXX/drs/dr4xx.cpp b/clang/test/CXX/drs/dr4xx.cpp index 1a5976eadaf..2e6a261ad0c 100644 --- a/clang/test/CXX/drs/dr4xx.cpp +++ b/clang/test/CXX/drs/dr4xx.cpp @@ -593,10 +593,10 @@ namespace dr447 { // dr447: yes U<__builtin_offsetof(A, n)>::type a; U<__builtin_offsetof(T, n)>::type b; // expected-error +{{}} expected-warning 0+{{}} // as an extension, we allow the member-designator to include array indices - g(__builtin_offsetof(A, a[0])).h<int>(); // expected-error {{extension}} - g(__builtin_offsetof(A, a[N])).h<int>(); // expected-error {{extension}} - U<__builtin_offsetof(A, a[0])>::type c; // expected-error {{extension}} - U<__builtin_offsetof(A, a[N])>::type d; // expected-error {{extension}} expected-error +{{}} expected-warning 0+{{}} + g(__builtin_offsetof(A, a[0])).h<int>(); + g(__builtin_offsetof(A, a[N])).h<int>(); + U<__builtin_offsetof(A, a[0])>::type c; + U<__builtin_offsetof(A, a[N])>::type d; // expected-error +{{}} expected-warning 0+{{}} } } |