diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-10-09 13:53:24 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-10-09 13:53:24 +0000 |
commit | 6269236a8ee11c973a9b14b299677c0509002c27 (patch) | |
tree | 3bf0fa449d41d280ccd35b414e5c8bdf80d3c7c0 /clang/lib/Sema/SemaDeclAttr.cpp | |
parent | 49692eda7e34aecb3c67396e75659ee68649cabe (diff) | |
download | bcm5719-llvm-6269236a8ee11c973a9b14b299677c0509002c27.tar.gz bcm5719-llvm-6269236a8ee11c973a9b14b299677c0509002c27.zip |
Amending r249721 to properly handle pathological attribute-related names like __ and ____.
Patch by Adrian Zgorzalek!
llvm-svn: 249833
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 2b38e0f8705..1f3497609e0 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1311,8 +1311,8 @@ void Sema::AddAssumeAlignedAttr(SourceRange AttrRange, Decl *D, Expr *E, /// Normalize the attribute, __foo__ becomes foo. /// Returns true if normalization was applied. static bool normalizeName(StringRef &AttrName) { - if (AttrName.startswith("__") && AttrName.endswith("__")) { - assert(AttrName.size() > 4 && "Name too short"); + if (AttrName.size() > 4 && AttrName.startswith("__") && + AttrName.endswith("__")) { AttrName = AttrName.drop_front(2).drop_back(2); return true; } |