diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-06-24 16:22:41 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-06-24 16:22:41 +0000 |
commit | 709135b01b238ef34d701ec67219c7e410b265de (patch) | |
tree | aacd7ac5c60f8bff4f51c7fa3e751e89fcadcbb6 /lib | |
parent | d3694b66873bfd1a753527b49752b63f4236e44d (diff) | |
download | clang-709135b01b238ef34d701ec67219c7e410b265de.tar.gz clang-709135b01b238ef34d701ec67219c7e410b265de.tar.bz2 clang-709135b01b238ef34d701ec67219c7e410b265de.tar.xz |
Allow static_assert inside an anonymous union; fixes PR20021 as well as implements C++ Issue 1940.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index bdc8609116..90499d2749 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3754,6 +3754,8 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS, } } else if (isa<AccessSpecDecl>(Mem)) { // Any access specifier is fine. + } else if (isa<StaticAssertDecl>(Mem)) { + // In C++1z, static_assert declarations are also fine. } else { // We have something that isn't a non-static data // member. Complain about it. |