From a00399c94983fb424858113ca5cfab780834f184 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 12 Feb 2013 02:32:35 +0000 Subject: [PATCH] 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. llvm-svn: 174931 --- clang/include/clang/AST/DeclBase.h | 4 ++-- clang/test/Modules/Inputs/cxx-inline-namespace.h | 11 +++++++++++ clang/test/Modules/Inputs/module.map | 4 ++++ clang/test/Modules/cxx-inline-namespace.cpp | 6 ++++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 clang/test/Modules/Inputs/cxx-inline-namespace.h create mode 100644 clang/test/Modules/cxx-inline-namespace.cpp diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h index ef22074..5a9e9fe 100644 --- a/clang/include/clang/AST/DeclBase.h +++ b/clang/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/clang/test/Modules/Inputs/cxx-inline-namespace.h b/clang/test/Modules/Inputs/cxx-inline-namespace.h new file mode 100644 index 0000000..2525ad3 --- /dev/null +++ b/clang/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/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map index eeb8d15..f219036 100644 --- a/clang/test/Modules/Inputs/module.map +++ b/clang/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/clang/test/Modules/cxx-inline-namespace.cpp b/clang/test/Modules/cxx-inline-namespace.cpp new file mode 100644 index 0000000..5b96790 --- /dev/null +++ b/clang/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'}} -- 2.7.4