Matheus Izvekov 0a42c7c667
[clang] fix assert in ADL finding entity in the implicit global module (#109882)
This adds to the assert the implicit global module case as in module
purview.

Fixes #109879
2024-09-24 22:57:07 -03:00

30 lines
622 B
C++

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 %t/B.cppm -fprebuilt-module-path=%t -emit-module-interface -o %t/B.pcm
// RUN: %clang_cc1 -fsyntax-only -std=c++20 -fprebuilt-module-path=%t -verify %t/C.cpp
//--- foo.h
struct Bar {};
extern "C" void foo(struct Bar);
//--- A.cppm
module;
#include "foo.h"
export module A;
export extern "C" using ::foo;
//--- B.cppm
module;
import A;
export module B;
//--- C.cpp
// expected-no-diagnostics
import B;
#include "foo.h"
void test() {
foo(Bar());
}