diff options
Diffstat (limited to 'include/clang/AST/Decl.h')
| -rw-r--r-- | include/clang/AST/Decl.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 451f9da1b60a..e06b58b37be2 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -236,7 +236,11 @@ public: bool isHidden() const { return Hidden; } /// \brief Set whether this declaration is hidden from name lookup. - void setHidden(bool Hide) { Hidden = Hide; } + void setHidden(bool Hide) { + assert((!Hide || isFromASTFile() || hasLocalOwningModuleStorage()) && + "declaration with no owning module can't be hidden"); + Hidden = Hide; + } /// \brief Determine whether this declaration is a C++ class member. bool isCXXClassMember() const { |
