llvm-project/clang/test/Modules/export-in-non-modules.cpp
duhbbx fdec9fd4f8
[Clang] Fix export declaration diagnostic message (#149059)
Change the error message from "export declaration can only be used
within a module purview" to "export declaration can only be used within
a module interface" to be technically accurate.

The previous message was misleading because export declarations are
actually within a module purview when used in module implementation
units, but they are only allowed in module interface units.

This addresses the issue pointed out in GitHub issue #149008 where
Bigcheese noted that the diagnostic wording was incorrect.

Fixes #149008
2025-07-16 19:22:54 +02:00

5 lines
195 B
C++

// RUN: %clang_cc1 -std=c++20 %s -fsyntax-only -verify
export struct Unit { // expected-error {{export declaration can only be used within a module interface}}
bool operator<(const Unit &);
};