summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
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
commitf501cc313e9e0b633342943f2e3b2c62357b9ea8 (patch)
treecac4f10a0e05e65f0af4bcfbd597a16056624859 /clang/lib/Sema
parente5b7a2ccd2f132a643f6ebbe11557d01069024c4 (diff)
downloadbcm5719-llvm-f501cc313e9e0b633342943f2e3b2c62357b9ea8.tar.gz
bcm5719-llvm-f501cc313e9e0b633342943f2e3b2c62357b9ea8.zip
Workaround for libstdc++4.6 <atomic> bug: make comment more explicit about what's going on, per Sean Silva's suggestion.
llvm-svn: 165286
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index e989fd541f4..c898d81a61d 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud