aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-10-05 01:46:25 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-10-05 01:46:25 +0000
commitc969e6a7e4260fdb284593ed344b51f51e7225f6 (patch)
tree57717541711f3057e680c9a74d2bafeb63978695 /lib/Sema/SemaDeclCXX.cpp
parentb3f55c5728aaf0d28579e67db3dd34c2934e7805 (diff)
Workaround for libstdc++4.6 <atomic> bug: make comment more explicit about what's going on, per Sean Silva's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index e989fd541f..c898d81a61 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -5407,10 +5407,15 @@ static void DiagnoseNamespaceInlineMismatch(Sema &S, SourceLocation KeywordLoc,
NamespaceDecl *PrevNS) {
assert(*IsInline != PrevNS->isInline());
+ // HACK: Work around a bug in libstdc++4.6's <atomic>, where
+ // std::__atomic[0,1,2] are defined as non-inline namespaces, then reopened as
+ // inline namespaces, with the intention of bringing names into namespace std.
+ //
+ // We support this just well enough to get that case working; this is not
+ // sufficient to support reopening namespaces as inline in general.
if (*IsInline && II && II->getName().startswith("__atomic") &&
S.getSourceManager().isInSystemHeader(Loc)) {
- // libstdc++4.6's <atomic> reopens a non-inline namespace as inline, and
- // expects that to affect the earlier declaration.
+ // Mark all prior declarations of the namespace as inline.
for (NamespaceDecl *NS = PrevNS->getMostRecentDecl(); NS;
NS = NS->getPreviousDecl())
NS->setInline(*IsInline);