Remove an assert which triggers when a decl context in a module hits the 'has
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 12 Feb 2013 02:32:35 +0000 (02:32 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 12 Feb 2013 02:32:35 +0000 (02:32 +0000)
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
clang/test/Modules/Inputs/cxx-inline-namespace.h [new file with mode: 0644]
clang/test/Modules/Inputs/module.map
clang/test/Modules/cxx-inline-namespace.cpp [new file with mode: 0644]

index ef22074..5a9e9fe 100644 (file)
@@ -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 (file)
index 0000000..2525ad3
--- /dev/null
@@ -0,0 +1,11 @@
+namespace std {
+  inline namespace __1 {
+    namespace __is_function_imp {}
+  }
+}
+
+namespace std {
+  inline namespace __1 {
+    typedef int size_t;
+  }
+}
index eeb8d15..f219036 100644 (file)
@@ -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 (file)
index 0000000..5b96790
--- /dev/null
@@ -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'}}