diff options
author | Alex Lorenz <arphaman@gmail.com> | 2016-10-12 09:36:35 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2016-10-12 09:36:35 +0000 |
commit | 38df4e8d58547a691318935bb7d1d4be41e9803c (patch) | |
tree | 3b6d3f0185e6bb5e212fd89aa433035fdef7fa0a /include/clang/Basic/Attr.td | |
parent | 419410f8d612215c153474046d842762be8aed3a (diff) |
[Sema] Handle transparent_union attributes in C mode only
This commit marks the transparent_union attributes as C only because clang
doesn't support them in C++ mode. Prior to this commit, clang still tried to
verify these attributes in C++, leading to crashes when analyzing templated
transparent_union unions that have dependent field types. This commit ensures
that such crashes won't happen again.
As a result of this commit clang now displays a warning every time it encounters
a transparent_union attribute in C++ mode.
Differential Revision: https://reviews.llvm.org/D25308
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283995 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Attr.td')
-rw-r--r-- | include/clang/Basic/Attr.td | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index b4af0e5af8..1fea69ff0e 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -1543,6 +1543,7 @@ def TransparentUnion : InheritableAttr { let Spellings = [GCC<"transparent_union">]; // let Subjects = SubjectList<[Record, TypedefName]>; let Documentation = [Undocumented]; + let LangOpts = [COnly]; } def Unavailable : InheritableAttr { |