644 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir %t3// RUN: split-file --leading-lines %s %t4// RUN: %clang_cc1 -std=c++20 -pedantic-errors -fexceptions -fcxx-exceptions %t/cwg1884_A.cppm -triple x86_64-unknown-unknown -emit-module-interface -o %t/cwg1884_A.pcm5// RUN: %clang_cc1 -std=c++20 -verify=since-cxx20 -pedantic-errors -fexceptions -fcxx-exceptions -triple x86_64-unknown-unknown %t/cwg1884.cpp -fmodule-file=cwg1884_A=%t/cwg1884_A.pcm6// RUN: %clang_cc1 -std=c++23 -pedantic-errors -fexceptions -fcxx-exceptions %t/cwg1884_A.cppm -triple x86_64-unknown-unknown -emit-module-interface -o %t/cwg1884_A.pcm7// RUN: %clang_cc1 -std=c++23 -verify=since-cxx20 -pedantic-errors -fexceptions -fcxx-exceptions -triple x86_64-unknown-unknown %t/cwg1884.cpp -fmodule-file=cwg1884_A=%t/cwg1884_A.pcm8// RUN: %clang_cc1 -std=c++2c -pedantic-errors -fexceptions -fcxx-exceptions %t/cwg1884_A.cppm -triple x86_64-unknown-unknown -emit-module-interface -o %t/cwg1884_A.pcm9// RUN: %clang_cc1 -std=c++2c -verify=since-cxx20 -pedantic-errors -fexceptions -fcxx-exceptions -triple x86_64-unknown-unknown %t/cwg1884.cpp -fmodule-file=cwg1884_A=%t/cwg1884_A.pcm10 11// cwg1884: partial12// Cases b11, e11, g3, g4 are problematic, but we handle the other 101 cases fine.13 14// _N4993_.[basic.link]/11:15// For any two declarations of an entity E:16// — If one declares E to be a variable or function,17// the other shall declare E as one of the same type.18// — If one declares E to be an enumerator, the other shall do so.19// — If one declares E to be a namespace, the other shall do so.20// — If one declares E to be a type,21// the other shall declare E to be a type of the same kind (9.2.9.5).22// — If one declares E to be a class template,23// the other shall do so with the same kind and an equivalent template-head (13.7.7.2).24// [Note 5 : The declarations can supply different default template arguments. — end note]25// — If one declares E to be a function template or a (partial specialization of a) variable template,26// the other shall declare E to be one with an equivalent template-head and type.27// — If one declares E to be an alias template,28// the other shall declare E to be one with an equivalent template-head and defining-type-id.29// — If one declares E to be a concept, the other shall do so.30// Types are compared after all adjustments of types (during which typedefs (9.2.4) are replaced by their definitions);31// declarations for an array object can specify array types that differ by the presence or absence of a major array bound (9.3.4.5).32// No diagnostic is required if neither declaration is reachable from the other.33 34// The structure of the test is the following. First, module cwg1884_A35// provides all (significant) kinds of entities, each named 'a' through 'h', and copies of them.36// Then the .cpp file does MxN kind of testing, where it tests one kind of entity against every other kind.37 38//--- cwg1884_A.cppm39export module cwg1884_A;40 41export {42int a1;43int a2;44int a3;45int a4;46int a5;47int a6;48int a7;49int a8;50int a9;51int a10;52int a11;53void b1();54void b2();55void b3();56void b4();57void b5();58void b6();59void b7();60void b8();61void b9();62void b10();63void b11();64enum E {65 c1,66 c2, 67 c3,68 c4,69 c5,70 c6,71 c7,72 c8,73 c9,74 c1075};76namespace d1 {}77namespace d2 {}78namespace d3 {}79namespace d4 {}80namespace d5 {}81namespace d6 {}82namespace d7 {}83namespace d8 {}84namespace d9 {}85namespace d10 {}86struct e1;87struct e2;88struct e3;89struct e4;90struct e5;91struct e6;92struct e7;93struct e8;94struct e9;95struct e10;96struct e11;97struct e12;98struct e13;99template <typename>100class f1;101template <typename>102class f2;103template <typename>104class f3;105template <typename>106class f4;107template <typename>108class f5;109template <typename>110class f6;111template <typename>112class f7;113template <typename>114class f8;115template <typename>116class f9;117template <typename>118class f10;119template <typename>120class f11;121template <typename>122void g1(int);123template <typename>124void g2(int);125template <typename>126void g3(int);127template <typename>128void g4(int);129template <typename>130void g5(int);131template <typename>132void g6(int);133template <typename>134void g7(int);135template <typename>136void g8(int);137template <typename>138void g9(int);139template <typename>140void g10(int);141template <typename, typename>142int h1;143template <typename, typename>144int h2;145template <typename, typename>146int h3;147template <typename, typename>148int h4;149template <typename, typename>150int h5;151template <typename, typename>152int h6;153template <typename, typename>154int h7;155template <typename, typename>156int h8;157template <typename, typename>158int h9;159template <typename, typename>160int h10;161template <typename>162using i1 = int;163template <typename>164using i2 = int;165template <typename>166using i3 = int;167template <typename>168using i4 = int;169template <typename>170using i5 = int;171template <typename>172using i6 = int;173template <typename>174using i7 = int;175template <typename>176using i8 = int;177template <typename>178using i9 = int;179template <typename>180using i10 = int;181template <typename>182using i11 = int;183template <typename>184concept j1 = true;185template <typename>186concept j2 = true;187template <typename>188concept j3 = true;189template <typename>190concept j4 = true;191template <typename>192concept j5 = true;193template <typename>194concept j6 = true;195template <typename>196concept j7 = true;197template <typename>198concept j8 = true;199template <typename>200concept j9 = true;201template <typename>202concept j10 = true;203template <typename>204concept j11 = true;205} // export206 207 208//--- cwg1884.cpp209import cwg1884_A;210 211// FIXME: we don't diagnose several cases we should be. They are marked with MISSING prefix.212 213// Part A: matching against `int a;`214// ---------------------------------215 216void a1();217// since-cxx20-error@-1 {{redefinition of 'a1' as different kind of symbol}}218// since-cxx20-note@cwg1884_A.cppm:42 {{previous definition is here}}219enum Ea {220 a2221 // since-cxx20-error@-1 {{redefinition of 'a2'}}222 // since-cxx20-note@cwg1884_A.cppm:43 {{previous definition is here}}223};224namespace a3 {}225// since-cxx20-error@-1 {{redefinition of 'a3' as different kind of symbol}}226// since-cxx20-note@cwg1884_A.cppm:44 {{previous definition is here}}227struct a4;228// @-1 OK, types and variables do not correspond229template <typename>230class a5;231// since-cxx20-error@-1 {{redefinition of 'a5' as different kind of symbol}}232// since-cxx20-note@cwg1884_A.cppm:46 {{previous definition is here}}233template <typename>234void a6(int);235// since-cxx20-error@-1 {{redefinition of 'a6' as different kind of symbol}}236// since-cxx20-note@cwg1884_A.cppm:47 {{previous definition is here}}237template <typename, typename>238int a7;239// since-cxx20-error@-1 {{redefinition of 'a7' as different kind of symbol}}240// since-cxx20-note@cwg1884_A.cppm:48 {{previous definition is here}}241template <typename T>242int a8<T, int>;243// since-cxx20-error@-1 {{redefinition of 'a8' as different kind of symbol}}244// since-cxx20-note@cwg1884_A.cppm:49 {{previous definition is here}}245// since-cxx20-error@-3 {{expected ';' after top level declarator}}246template <typename>247using a9 = int;248// since-cxx20-error@-1 {{redefinition of 'a9' as different kind of symbol}}249// since-cxx20-note@cwg1884_A.cppm:50 {{previous definition is here}}250template <typename>251concept a10 = true;252// since-cxx20-error@-1 {{redefinition of 'a10' as different kind of symbol}}253// since-cxx20-note@cwg1884_A.cppm:51 {{previous definition is here}}254// For variables, type has to match as well.255long a11;256// since-cxx20-error@-1 {{redefinition of 'a11' with a different type: 'long' vs 'int'}}257// since-cxx20-note@cwg1884_A.cppm:52 {{previous definition is here}}258 259 260// Part B: matching against `void b();`261// ------------------------------------262 263int b1;264// since-cxx20-error@-1 {{redefinition of 'b1' as different kind of symbol}}265// since-cxx20-note@cwg1884_A.cppm:53 {{previous definition is here}}266enum Eb {267 b2268 // since-cxx20-error@-1 {{redefinition of 'b2'}}269 // since-cxx20-note@cwg1884_A.cppm:54 {{previous definition is here}}270};271namespace b3 {} // #cwg1884-namespace-b272// since-cxx20-error@-1 {{redefinition of 'b3' as different kind of symbol}}273// since-cxx20-note@cwg1884_A.cppm:55 {{previous definition is here}}274struct b4;275// @-1 OK, types and functions do not correspond276template <typename>277class b5;278// since-cxx20-error@-1 {{redefinition of 'b5' as different kind of symbol}}279// since-cxx20-note@cwg1884_A.cppm:57 {{previous definition is here}}280template <typename>281void b6(int);282// @-1 OK, a non-corresponding overload283template <typename, typename>284int b7;285// since-cxx20-error@-1 {{redefinition of 'b7' as different kind of symbol}}286// since-cxx20-note@cwg1884_A.cppm:59 {{previous definition is here}}287template <typename T>288int b8<T, int>;289// since-cxx20-error@-1 {{no variable template matches partial specialization}}290template <typename>291using b9 = int;292// since-cxx20-error@-1 {{redefinition of 'b9' as different kind of symbol}}293// since-cxx20-note@cwg1884_A.cppm:61 {{previous definition is here}}294template <typename>295concept b10 = true;296// since-cxx20-error@-1 {{redefinition of 'b10' as different kind of symbol}}297// since-cxx20-note@cwg1884_A.cppm:62 {{previous definition is here}}298// For functions, type has to match as well.299// FIXME: we should be loud and clear here about type mismatch, like we do in `a11` case.300int b11();301// since-cxx20-error@-1 {{declaration of 'b11' in the global module follows declaration in module cwg1884_A}}302// since-cxx20-note@cwg1884_A.cppm:63 {{previous declaration is here}}303 304 305// Part C: matching against `enum E { c };`306// ----------------------------------------307 308int c1;309// since-cxx20-error@-1 {{redefinition of 'c1' as different kind of symbol}}310// since-cxx20-note@cwg1884_A.cppm:65 {{previous definition is here}}311void c2();312// since-cxx20-error@-1 {{redefinition of 'c2' as different kind of symbol}}313// since-cxx20-note@cwg1884_A.cppm:66 {{previous definition is here}}314namespace c3 {}315// since-cxx20-error@-1 {{redefinition of 'c3' as different kind of symbol}}316// since-cxx20-note@cwg1884_A.cppm:67 {{previous definition is here}}317struct c4;318// @-1 OK, types and enumerators do not correspond319template <typename>320class c5;321// since-cxx20-error@-1 {{redefinition of 'c5' as different kind of symbol}}322// since-cxx20-note@cwg1884_A.cppm:69 {{previous definition is here}}323template <typename>324void c6(int);325// since-cxx20-error@-1 {{redefinition of 'c6' as different kind of symbol}}326// since-cxx20-note@cwg1884_A.cppm:70 {{previous definition is here}}327template <typename, typename>328int c7;329// since-cxx20-error@-1 {{redefinition of 'c7' as different kind of symbol}}330// since-cxx20-note@cwg1884_A.cppm:71 {{previous definition is here}}331template <typename T>332int c8<T, int>;333// since-cxx20-error@-1 {{redefinition of 'c8' as different kind of symbol}}334// since-cxx20-note@cwg1884_A.cppm:72 {{previous definition is here}}335// since-cxx20-error@-3 {{expected ';' after top level declarator}}336template <typename>337using c9 = int;338// since-cxx20-error@-1 {{redefinition of 'c9' as different kind of symbol}}339// since-cxx20-note@cwg1884_A.cppm:73 {{previous definition is here}}340template <typename>341concept c10 = true;342// since-cxx20-error@-1 {{redefinition of 'c10' as different kind of symbol}}343// since-cxx20-note@cwg1884_A.cppm:74 {{previous definition is here}}344 345 346// Part D: matching against `namespace d {};`347// ------------------------------------------348 349int d1;350// since-cxx20-error@-1 {{redefinition of 'd1' as different kind of symbol}}351// since-cxx20-note@cwg1884_A.cppm:76 {{previous definition is here}}352void d2();353// since-cxx20-error@-1 {{redefinition of 'd2' as different kind of symbol}}354// since-cxx20-note@cwg1884_A.cppm:77 {{previous definition is here}}355enum Ed {356 d3357 // since-cxx20-error@-1 {{redefinition of 'd3'}}358 // since-cxx20-note@cwg1884_A.cppm:78 {{previous definition is here}}359};360struct d4;361// since-cxx20-error@-1 {{redefinition of 'd4' as different kind of symbol}}362// since-cxx20-note@cwg1884_A.cppm:79 {{previous definition is here}}363template <typename>364class d5;365// since-cxx20-error@-1 {{redefinition of 'd5' as different kind of symbol}}366// since-cxx20-note@cwg1884_A.cppm:80 {{previous definition is here}}367template <typename>368void d6(int);369// since-cxx20-error@-1 {{redefinition of 'd6' as different kind of symbol}}370// since-cxx20-note@cwg1884_A.cppm:81 {{previous definition is here}}371template <typename, typename>372int d7;373// since-cxx20-error@-1 {{redefinition of 'd7' as different kind of symbol}}374// since-cxx20-note@cwg1884_A.cppm:82 {{previous definition is here}}375template <typename T>376int d8<T, int>;377// since-cxx20-error@-1 {{redefinition of 'd8' as different kind of symbol}}378// since-cxx20-note@cwg1884_A.cppm:83 {{previous definition is here}}379// since-cxx20-error@-3 {{expected ';' after top level declarator}}380template <typename>381using d9 = int;382// since-cxx20-error@-1 {{redefinition of 'd9' as different kind of symbol}}383// since-cxx20-note@cwg1884_A.cppm:84 {{previous definition is here}}384template <typename>385concept d10 = true;386// since-cxx20-error@-1 {{redefinition of 'd10' as different kind of symbol}}387// since-cxx20-note@cwg1884_A.cppm:85 {{previous definition is here}}388 389 390// Part E: matching against `struct e;`391// ------------------------------------392 393int e1;394// @-1 OK, types and variables do not correspond395void e2();396// @-1 OK, types and functions do not correspond397enum Ee {398 e3399 // @-1 OK, types and enumerators do not correspond400};401namespace e4 {}402// since-cxx20-error@-1 {{redefinition of 'e4' as different kind of symbol}}403// since-cxx20-note@cwg1884_A.cppm:89 {{previous definition is here}}404template <typename>405class e5;406// since-cxx20-error@-1 {{redefinition of 'e5' as different kind of symbol}}407// since-cxx20-note@cwg1884_A.cppm:90 {{previous definition is here}}408template <typename>409void e6(int);410// @-1 OK, types and function templates do not correspond411template <typename, typename>412int e7;413// since-cxx20-error@-1 {{redefinition of 'e7' as different kind of symbol}}414// since-cxx20-note@cwg1884_A.cppm:92 {{previous definition is here}}415template <typename T>416int e8<T, int>;417// since-cxx20-error@-1 {{redefinition of 'e8' as different kind of symbol}}418// since-cxx20-note@cwg1884_A.cppm:93 {{previous definition is here}}419// since-cxx20-error@-3 {{expected ';' after top level declarator}}420template <typename>421using e9 = int;422// since-cxx20-error@-1 {{redefinition of 'e9' as different kind of symbol}}423// since-cxx20-note@cwg1884_A.cppm:94 {{previous definition is here}}424template <typename>425concept e10 = true;426// since-cxx20-error@-1 {{redefinition of 'e10' as different kind of symbol}}427// since-cxx20-note@cwg1884_A.cppm:95 {{previous definition is here}}428// FIXME: the following forward declaration is well-formed.429// Agreement on 'struct' vs 'class' is not required per [dcl.type.elab]/7.430class e11;431// since-cxx20-error@-1 {{declaration of 'e11' in the global module follows declaration in module cwg1884_A}}432// since-cxx20-note@cwg1884_A.cppm:96 {{previous declaration is here}}433union e12;434// since-cxx20-error@-1 {{use of 'e12' with tag type that does not match previous declaration}}435// since-cxx20-note@cwg1884_A.cppm:97 {{previous use is here}}436// since-cxx20-error@-3 {{declaration of 'e12' in the global module follows declaration in module cwg1884_A}}437// since-cxx20-note@cwg1884_A.cppm:97 {{previous declaration is here}}438enum e13 {};439// since-cxx20-error@-1 {{use of 'e13' with tag type that does not match previous declaration}}440// since-cxx20-note@cwg1884_A.cppm:98 {{previous use is here}}441 442 443// Part F: matching against `template <typename> class f;`444// -------------------------------------------------------445 446int f1;447// since-cxx20-error@-1 {{redefinition of 'f1' as different kind of symbol}}448// since-cxx20-note@cwg1884_A.cppm:100 {{previous definition is here}}449void f2();450// since-cxx20-error@-1 {{redefinition of 'f2' as different kind of symbol}}451// since-cxx20-note@cwg1884_A.cppm:102 {{previous definition is here}}452enum Ef {453 f3454 // since-cxx20-error@-1 {{redefinition of 'f3'}}455 // since-cxx20-note@cwg1884_A.cppm:104 {{previous definition is here}}456};457namespace f4 {}458// since-cxx20-error@-1 {{redefinition of 'f4' as different kind of symbol}}459// since-cxx20-note@cwg1884_A.cppm:106 {{previous definition is here}}460struct f5;461// since-cxx20-error@-1 {{redefinition of 'f5' as different kind of symbol}}462// since-cxx20-note@cwg1884_A.cppm:108 {{previous definition is here}}463template <typename>464void f6(int);465// since-cxx20-error@-1 {{redefinition of 'f6' as different kind of symbol}}466// since-cxx20-note@cwg1884_A.cppm:110 {{previous definition is here}}467template <typename, typename>468int f7;469// since-cxx20-error@-1 {{redefinition of 'f7' as different kind of symbol}}470// since-cxx20-note@cwg1884_A.cppm:112 {{previous definition is here}}471template <typename T>472int f8<T, int>;473// since-cxx20-error@-1 {{no variable template matches partial specialization}}474template <typename>475using f9 = int;476// since-cxx20-error@-1 {{redefinition of 'f9' as different kind of symbol}}477// since-cxx20-note@cwg1884_A.cppm:116 {{previous definition is here}}478template <typename>479concept f10 = true;480// since-cxx20-error@-1 {{redefinition of 'f10' as different kind of symbol}}481// since-cxx20-note@cwg1884_A.cppm:118 {{previous definition is here}}482 483 484// Part G: matching against `template <typename> void g(int);`485// -----------------------------------------------------------486 487int g1;488// since-cxx20-error@-1 {{redefinition of 'g1' as different kind of symbol}}489// since-cxx20-note@cwg1884_A.cppm:122 {{previous definition is here}}490void g2();491// @-1 OK, a non-corresponding overload492enum Eg {493 g3494 // MISSING-since-cxx20-error@-1 {{redefinition of 'g3'}}495 // MISSING-since-cxx20-note@cwg1884_A.cppm:126 {{previous definition is here}}496};497namespace g4 {}498// MISSING-since-cxx20-error@-1 {{redefinition of 'g4' as different kind of symbol}}499// MISSING-since-cxx20-note@cwg1884_A.cppm:128 {{previous definition is here}}500struct g5;501// @-1 OK, types and function templates do not correspond502template <typename>503class g6;504// since-cxx20-error@-1 {{redefinition of 'g6' as different kind of symbol}}505// since-cxx20-note@cwg1884_A.cppm:132 {{previous definition is here}}506template <typename, typename>507int g7;508// since-cxx20-error@-1 {{redefinition of 'g7' as different kind of symbol}}509// since-cxx20-note@cwg1884_A.cppm:134 {{previous definition is here}}510template <typename T>511int g8<T, int>;512// since-cxx20-error@-1 {{no variable template matches specialization; did you mean to use 'g8' as function template instead?}}513template <typename>514using g9 = int;515// since-cxx20-error@-1 {{redefinition of 'g9' as different kind of symbol}}516// since-cxx20-note@cwg1884_A.cppm:138 {{previous definition is here}}517template <typename>518concept g10 = true;519// since-cxx20-error@-1 {{redefinition of 'g10' as different kind of symbol}}520// since-cxx20-note@cwg1884_A.cppm:140 {{previous definition is here}}521 522 523// Part H: matching against `template <typename, typename> int h;`524// ---------------------------------------------------------------525 526int h1;527// since-cxx20-error@-1 {{redefinition of 'h1' as different kind of symbol}}528// since-cxx20-note@cwg1884_A.cppm:142 {{previous definition is here}}529void h2();530// since-cxx20-error@-1 {{redefinition of 'h2' as different kind of symbol}}531// since-cxx20-note@cwg1884_A.cppm:144 {{previous definition is here}}532enum Eh {533 h3534 // since-cxx20-error@-1 {{redefinition of 'h3'}}535 // since-cxx20-note@cwg1884_A.cppm:146 {{previous definition is here}}536};537namespace h4 {}538// since-cxx20-error@-1 {{redefinition of 'h4' as different kind of symbol}}539// since-cxx20-note@cwg1884_A.cppm:148 {{previous definition is here}}540struct h5;541// since-cxx20-error@-1 {{redefinition of 'h5' as different kind of symbol}}542// since-cxx20-note@cwg1884_A.cppm:150 {{previous definition is here}}543template <typename>544class h6;545// since-cxx20-error@-1 {{redefinition of 'h6' as different kind of symbol}}546// since-cxx20-note@cwg1884_A.cppm:152 {{previous definition is here}}547template <typename>548void h7(int);549// since-cxx20-error@-1 {{redefinition of 'h7' as different kind of symbol}}550// since-cxx20-note@cwg1884_A.cppm:154 {{previous definition is here}}551template <typename T>552int h8<T, int>;553// @-1 OK, partial specialization554template <typename>555using h9 = int;556// since-cxx20-error@-1 {{redefinition of 'h9' as different kind of symbol}}557// since-cxx20-note@cwg1884_A.cppm:158 {{previous definition is here}}558template <typename>559concept h10 = true;560// since-cxx20-error@-1 {{redefinition of 'h10' as different kind of symbol}}561// since-cxx20-note@cwg1884_A.cppm:160 {{previous definition is here}}562 563 564// Part I: matching against `template <typename> using i = int;`565// -------------------------------------------------------------566 567int i1;568// since-cxx20-error@-1 {{redefinition of 'i1' as different kind of symbol}}569// since-cxx20-note@cwg1884_A.cppm:162 {{previous definition is here}}570void i2();571// since-cxx20-error@-1 {{redefinition of 'i2' as different kind of symbol}}572// since-cxx20-note@cwg1884_A.cppm:164 {{previous definition is here}}573enum Ei {574 i3575 // since-cxx20-error@-1 {{redefinition of 'i3'}}576 // since-cxx20-note@cwg1884_A.cppm:166 {{previous definition is here}}577};578namespace i4 {}579// since-cxx20-error@-1 {{redefinition of 'i4' as different kind of symbol}}580// since-cxx20-note@cwg1884_A.cppm:168 {{previous definition is here}}581struct i5;582// since-cxx20-error@-1 {{redefinition of 'i5' as different kind of symbol}}583// since-cxx20-note@cwg1884_A.cppm:170 {{previous definition is here}}584template <typename>585class i6;586// since-cxx20-error@-1 {{redefinition of 'i6' as different kind of symbol}}587// since-cxx20-note@cwg1884_A.cppm:172 {{previous definition is here}}588template <typename>589void i7(int);590// since-cxx20-error@-1 {{redefinition of 'i7' as different kind of symbol}}591// since-cxx20-note@cwg1884_A.cppm:174 {{previous definition is here}}592template <typename, typename>593int i8;594// since-cxx20-error@-1 {{redefinition of 'i8' as different kind of symbol}}595// since-cxx20-note@cwg1884_A.cppm:176 {{previous definition is here}}596template <typename T>597int i9<T, int>;598// since-cxx20-error@-1 {{no variable template matches partial specialization}}599template <typename>600concept i10 = true;601// since-cxx20-error@-1 {{redefinition of 'i10' as different kind of symbol}}602// since-cxx20-note@cwg1884_A.cppm:180 {{previous definition is here}}603 604 605// Part J: matching against `template <typename> concept j = true;`606// ----------------------------------------------------------------607 608int j1;609// since-cxx20-error@-1 {{redefinition of 'j1' as different kind of symbol}}610// since-cxx20-note@cwg1884_A.cppm:184 {{previous definition is here}}611void j2();612// since-cxx20-error@-1 {{redefinition of 'j2' as different kind of symbol}}613// since-cxx20-note@cwg1884_A.cppm:186 {{previous definition is here}}614enum Ej {615 j3616 // since-cxx20-error@-1 {{redefinition of 'j3'}}617 // since-cxx20-note@cwg1884_A.cppm:188 {{previous definition is here}}618};619namespace j4 {}620// since-cxx20-error@-1 {{redefinition of 'j4' as different kind of symbol}}621// since-cxx20-note@cwg1884_A.cppm:190 {{previous definition is here}}622struct j5;623// since-cxx20-error@-1 {{redefinition of 'j5' as different kind of symbol}}624// since-cxx20-note@cwg1884_A.cppm:192 {{previous definition is here}}625template <typename>626class j6;627// since-cxx20-error@-1 {{redefinition of 'j6' as different kind of symbol}}628// since-cxx20-note@cwg1884_A.cppm:194 {{previous definition is here}}629template <typename>630void j7(int);631// since-cxx20-error@-1 {{redefinition of 'j7' as different kind of symbol}}632// since-cxx20-note@cwg1884_A.cppm:196 {{previous definition is here}}633template <typename, typename>634int j8;635// since-cxx20-error@-1 {{redefinition of 'j8' as different kind of symbol}}636// since-cxx20-note@cwg1884_A.cppm:198 {{previous definition is here}}637template <typename T>638int j9<T, int>;639// since-cxx20-error@-1 {{no variable template matches partial specialization}}640template <typename>641using j10 = int;642// since-cxx20-error@-1 {{redefinition of 'j10' as different kind of symbol}}643// since-cxx20-note@cwg1884_A.cppm:202 {{previous definition is here}}644