Chuanqi Xu db3d0e4dfa [C++20] [Modules] Don't diagnose on invisible namesapce
Close https://github.com/llvm/llvm-project/issues/73893

As the issue shows, generally, the diagnose information for
invisible namespace is confusing more than helpful. Also this patch
implements the same solution as suggested in the issue: don't diagnose
on invisible namespace.
2023-12-04 17:05:27 +08:00

23 lines
453 B
C++

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/foo.cppm -I%t -emit-module-interface -o %t/foo.pcm
// RUN: %clang_cc1 -std=c++20 %t/use.cc -fmodule-file=foo=%t/foo.pcm -fsyntax-only -verify
//--- foo.h
namespace foo {
}
//--- foo.cppm
module;
#include "foo.h"
export module foo;
//--- use.cc
import foo;
void use() {
foo::bar(); // expected-error {{no member named 'bar' in namespace 'foo'}}
}