diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-12 02:32:35 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-12 02:32:35 +0000 |
commit | 63a9514a2330b144575a136e38875193760126f7 (patch) | |
tree | a1b49fa1ff065237087ee6829f80a4e501a6fd3f | |
parent | a2905ea609c8ed1bf41a6b917358983d9f26dc6d (diff) |
Remove an assert which triggers when a decl context in a module hits the 'has
lexical storage but not visible storage' case in C++. It's unclear whether we
even need the special-case handling for C++, since it seems to be working
around our not serializing a lookup table for the TU in C. But in any case,
the assertion is incorrect.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174931 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/DeclBase.h | 4 | ||||
-rw-r--r-- | test/Modules/Inputs/cxx-inline-namespace.h | 11 | ||||
-rw-r--r-- | test/Modules/Inputs/module.map | 4 | ||||
-rw-r--r-- | test/Modules/cxx-inline-namespace.cpp | 6 |
4 files changed, 23 insertions, 2 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index ef220745a8..5a9e9fedfa 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -1477,9 +1477,9 @@ public: // Low-level accessors /// \brief Mark the lookup table as needing to be built. This should be - /// used only if setHasExternalLexicalStorage() has been called. + /// used only if setHasExternalLexicalStorage() has been called on any + /// decl context for which this is the primary context. void setMustBuildLookupTable() { - assert(ExternalLexicalStorage && "Requires external lexical storage"); LookupPtr.setInt(true); } diff --git a/test/Modules/Inputs/cxx-inline-namespace.h b/test/Modules/Inputs/cxx-inline-namespace.h new file mode 100644 index 0000000000..2525ad3569 --- /dev/null +++ b/test/Modules/Inputs/cxx-inline-namespace.h @@ -0,0 +1,11 @@ +namespace std { + inline namespace __1 { + namespace __is_function_imp {} + } +} + +namespace std { + inline namespace __1 { + typedef int size_t; + } +} diff --git a/test/Modules/Inputs/module.map b/test/Modules/Inputs/module.map index eeb8d158e5..f219036e21 100644 --- a/test/Modules/Inputs/module.map +++ b/test/Modules/Inputs/module.map @@ -175,3 +175,7 @@ module ignored_macros { module cxx_many_overloads { header "cxx-many-overloads.h" } + +module cxx_inline_namespace { + header "cxx-inline-namespace.h" +} diff --git a/test/Modules/cxx-inline-namespace.cpp b/test/Modules/cxx-inline-namespace.cpp new file mode 100644 index 0000000000..5b967901b3 --- /dev/null +++ b/test/Modules/cxx-inline-namespace.cpp @@ -0,0 +1,6 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11 + +@import cxx_inline_namespace; + +T x; // expected-error {{unknown type name 'T'}} |