summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2017-11-21 19:25:38 +0000
committerAaron Ballman <aaron@aaronballman.com>2017-11-21 19:25:38 +0000
commit52a3ca9e290925b5900c3176db455b70fdd51529 (patch)
treec0b0467017558712fcb07618237554799cdad3e3 /clang/lib/Sema/SemaExpr.cpp
parent58166b13e093a8f4eda9ee6bd36e733bd133b62f (diff)
downloadbcm5719-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/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index f895e0fa1f5..4df9a81babd 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -12588,15 +12588,7 @@ ExprResult Sema::BuildBuiltinOffsetOf(SourceLocation BuiltinLoc,
&& RequireCompleteType(BuiltinLoc, ArgTy,
diag::err_offsetof_incomplete_type, TypeRange))
return ExprError();
-
- // offsetof with non-identifier designators (e.g. "offsetof(x, a.b[c])") are a
- // GCC extension, diagnose them.
- // FIXME: This diagnostic isn't actually visible because the location is in
- // a system header!
- if (Components.size() != 1)
- Diag(BuiltinLoc, diag::ext_offsetof_extended_field_designator)
- << SourceRange(Components[1].LocStart, Components.back().LocEnd);
-
+
bool DidWarnAboutNonPOD = false;
QualType CurrentType = ArgTy;
SmallVector<OffsetOfNode, 4> Comps;
OpenPOWER on IntegriCloud