================ @@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -pedantic-errors %s + +namespace c { + extern "C" void main(); // expected-error {{invalid linkage specification 'extern "C"'}} +} +extern "C" { + int main(); // expected-error {{invalid linkage specification 'extern "C"'}} +} +extern "C" int main(); // expected-error {{invalid linkage specification 'extern "C"'}} +extern "C" struct A { int main(); }; // ok + +namespace cpp { + extern "C++" int main(); // expected-error {{invalid linkage specification 'extern "C++"'}} ---------------- a-tarasyuk wrote:
@MitalAshok Thanks for the feedback. I've added [linkage3.cpp](https://github.com/llvm/llvm-project/pull/101853/files#diff-dc2bba9678021106302e8711c2140ad1e575de50b157537e64b37621e97b9ec9) to cover this case. https://github.com/llvm/llvm-project/pull/101853 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits