[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / cxx20-10-2-ex4.cpp
blob793e9964aa9dc187bf196163b1535601786abc09
1 // Based on C++20 10.2 example 4.
3 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %s -verify -o %t
5 export module M;
7 struct S { // expected-note {{previous declaration is here}}
8 int n;
9 };
10 typedef S S;
11 export typedef S S; // OK, does not redeclare an entity
12 export struct S; // expected-error {{cannot export redeclaration 'S' here since the previous declaration has module linkage}}