[PATCH] Consolidate several functions for checking the std namespace into one function in Decl and one function in DeclContext

Richard Smith richard at metafoo.co.uk
Tue May 20 18:22:39 PDT 2014


+bool DeclContext::isStdNamespace(bool IncludeInlineNamespace) const {
[...]
+  if (!getParent()->getRedeclContext()->isTranslationUnit())
+    return false;

This returns the wrong result if 'std' is itself in an inline namespace,
but I guess we don't need to care about that.

I think the default of IncludeInlineNamespace should be true, not false.
The call in SemaExceptionSpec should set it to 'true', as should all the
calls in the static analyzer, and that only leaves the
SemaTemplateInstantiateDecl call, where we don't care. Can the parameter be
removed altogether?

http://reviews.llvm.org/D3333






More information about the cfe-commits mailing list