[PATCH] D153701: [Clang] Implement P2718R0 "Lifetime extension in range-based for loops"

2023-11-16 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

@yronglin We are sorry it takes so much time to get feedback. Richard and 
Hubert have little bandwidth for reviews. Others, including me, don't feel 
qualified to provide good feedback.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153701/new/

https://reviews.llvm.org/D153701

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121723: [clang] CWG 2354: prohibit alignas for enums

2022-03-15 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Herald added a reviewer: aaron.ballman.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121723

Files:
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
  clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
  clang/test/CXX/drs/dr2354.cpp
  clang/www/cxx_dr_status.html

Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -13938,7 +13938,7 @@
 https://wg21.link/cwg2354";>2354
 CD5
 Extended alignment and object representation
-Unknown
+Clang 15
   
   
 https://wg21.link/cwg2355";>2355
Index: clang/test/CXX/drs/dr2354.cpp
===
--- /dev/null
+++ clang/test/CXX/drs/dr2354.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -x c++ -verify %s 
+
+// dr2354: 15
+
+namespace DR2354 {
+
+enum alignas(64) A {};// expected-error {{'alignas' attribute cannot be applied to an enumeration}}
+enum struct alignas(64) B {}; // expected-error {{'alignas' attribute cannot be applied to an enumeration}}
+
+} // namespace DR2354
Index: clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
===
--- clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
+++ clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
@@ -27,21 +27,6 @@
 int n9; // expected-error {{'alignas' must be specified on definition if it is specified on any declaration}}
 alignas(4) extern int n9; // expected-note {{declared with 'alignas' attribute here}}
 
-
-enum alignas(2) E : char; // expected-note {{declared with 'alignas' attribute here}}
-enum E : char {}; // expected-error {{'alignas' must be specified on definition if it is specified on any declaration}}
-
-enum alignas(4) F : char; // expected-note {{previous declaration is here}}
-enum alignas(2) F : char; // expected-error {{redeclaration has different alignment requirement (2 vs 4)}}
-
-enum G : char;
-enum alignas(8) G : char {};
-enum G : char;
-
-enum H : char {}; // expected-error {{'alignas' must be specified on definition if it is specified on any declaration}}
-enum alignas(1) H : char; // expected-note {{declared with 'alignas' attribute here}}
-
-
 struct S;
 struct alignas(16) S; // expected-note {{declared with 'alignas' attribute here}}
 struct S;
@@ -73,14 +58,5 @@
 char *x1848 = X<1,8,4,8>::Buffer; // ok
 char *x1248 = X<1,2,4,8>::Buffer; // expected-note {{in instantiation of}}
 
-template struct Y {
-  enum alignas(M) alignas(N) E : char;
-};
-template
-enum alignas(O) alignas(P) Y::E : char { e };
-int y1848 = Y<1,8,4,8>::e;
-// FIXME: We should reject this.
-int y1248 = Y<1,2,4,8>::e;
-
 // Don't crash here.
 alignas(4) struct Incomplete incomplete; // expected-error {{incomplete type}} expected-note {{forward declaration}}
Index: clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
===
--- clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
+++ clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
@@ -11,13 +11,6 @@
 alignas(8) int n9 alignas(2); // ok, overaligned
 alignas(1) extern int n10; // expected-error {{less than minimum alignment}}
 
-enum alignas(1) E1 {}; // expected-error {{requested alignment is less than minimum alignment of 4 for type 'E1'}}
-enum alignas(1) E2 : char {}; // ok
-enum alignas(4) E3 { e3 = 0 }; // ok
-enum alignas(4) E4 { e4 = 1ull << 33 }; // expected-error {{requested alignment is less than minimum alignment of 8 for type 'E4'}}
-enum alignas(8) E5 {};
-static_assert(alignof(E5) == 8, "");
-
 typedef __attribute__((aligned(16))) int IntAlign16;
 enum E6 : IntAlign16 {};
 static_assert(alignof(E6) == 4, "");
@@ -62,15 +55,6 @@
 template struct X<16, 8, S1>;
 template struct X<4, 4, S1>; // expected-note {{instantiation}}
 
-template
-struct Y {
-  enum alignas(N) E : T {}; // expected-error {{requested alignment is less than minimum}}
-};
-template struct Y<1, char>;
-template struct Y<2, char>;
-template struct Y<1, short>; // expected-note {{instantiation}}
-template struct Y<2, short>;
-
 template
 void f() {
   alignas(N) T v; // expected-error {{requested alignment is less than minimum}}
Index: clang/lib/Sema/SemaDeclAttr.cpp
===
--- clang/lib/Sema/SemaDeclAttr.cpp
+++ clang/lib/Sema/SemaDeclAttr.cpp
@@ -4305,6 +4305,9 @@
 } else if (const auto *FD = dyn_cast(D)) {
   if (FD->isBitField())
 DiagKind = 3;
+} else if (const auto *ED = dyn_cast(D)) {
+  if (ED->getLangOpts().CPlusPlus)
+DiagKind = 4;
 } else if (!isa(D)) {
   Diag(AttrLoc, diag::err_attribute_wrong_decl_type) <

[PATCH] D121723: [clang] CWG 2354: prohibit alignas for enums

2022-03-15 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 415524.
Endill added a comment.

Fix warning about clang-format being missing


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121723/new/

https://reviews.llvm.org/D121723

Files:
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
  clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
  clang/test/CXX/drs/dr2354.cpp
  clang/www/cxx_dr_status.html

Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -13938,7 +13938,7 @@
 https://wg21.link/cwg2354";>2354
 CD5
 Extended alignment and object representation
-Unknown
+Clang 15
   
   
 https://wg21.link/cwg2355";>2355
Index: clang/test/CXX/drs/dr2354.cpp
===
--- /dev/null
+++ clang/test/CXX/drs/dr2354.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -x c++ -verify %s 
+
+// dr2354: 15
+
+namespace DR2354 {
+
+enum alignas(64) A {};// expected-error {{'alignas' attribute cannot be applied to an enumeration}}
+enum struct alignas(64) B {}; // expected-error {{'alignas' attribute cannot be applied to an enumeration}}
+
+} // namespace DR2354
Index: clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
===
--- clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
+++ clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
@@ -27,21 +27,6 @@
 int n9; // expected-error {{'alignas' must be specified on definition if it is specified on any declaration}}
 alignas(4) extern int n9; // expected-note {{declared with 'alignas' attribute here}}
 
-
-enum alignas(2) E : char; // expected-note {{declared with 'alignas' attribute here}}
-enum E : char {}; // expected-error {{'alignas' must be specified on definition if it is specified on any declaration}}
-
-enum alignas(4) F : char; // expected-note {{previous declaration is here}}
-enum alignas(2) F : char; // expected-error {{redeclaration has different alignment requirement (2 vs 4)}}
-
-enum G : char;
-enum alignas(8) G : char {};
-enum G : char;
-
-enum H : char {}; // expected-error {{'alignas' must be specified on definition if it is specified on any declaration}}
-enum alignas(1) H : char; // expected-note {{declared with 'alignas' attribute here}}
-
-
 struct S;
 struct alignas(16) S; // expected-note {{declared with 'alignas' attribute here}}
 struct S;
@@ -73,14 +58,5 @@
 char *x1848 = X<1,8,4,8>::Buffer; // ok
 char *x1248 = X<1,2,4,8>::Buffer; // expected-note {{in instantiation of}}
 
-template struct Y {
-  enum alignas(M) alignas(N) E : char;
-};
-template
-enum alignas(O) alignas(P) Y::E : char { e };
-int y1848 = Y<1,8,4,8>::e;
-// FIXME: We should reject this.
-int y1248 = Y<1,2,4,8>::e;
-
 // Don't crash here.
 alignas(4) struct Incomplete incomplete; // expected-error {{incomplete type}} expected-note {{forward declaration}}
Index: clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
===
--- clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
+++ clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
@@ -11,13 +11,6 @@
 alignas(8) int n9 alignas(2); // ok, overaligned
 alignas(1) extern int n10; // expected-error {{less than minimum alignment}}
 
-enum alignas(1) E1 {}; // expected-error {{requested alignment is less than minimum alignment of 4 for type 'E1'}}
-enum alignas(1) E2 : char {}; // ok
-enum alignas(4) E3 { e3 = 0 }; // ok
-enum alignas(4) E4 { e4 = 1ull << 33 }; // expected-error {{requested alignment is less than minimum alignment of 8 for type 'E4'}}
-enum alignas(8) E5 {};
-static_assert(alignof(E5) == 8, "");
-
 typedef __attribute__((aligned(16))) int IntAlign16;
 enum E6 : IntAlign16 {};
 static_assert(alignof(E6) == 4, "");
@@ -62,15 +55,6 @@
 template struct X<16, 8, S1>;
 template struct X<4, 4, S1>; // expected-note {{instantiation}}
 
-template
-struct Y {
-  enum alignas(N) E : T {}; // expected-error {{requested alignment is less than minimum}}
-};
-template struct Y<1, char>;
-template struct Y<2, char>;
-template struct Y<1, short>; // expected-note {{instantiation}}
-template struct Y<2, short>;
-
 template
 void f() {
   alignas(N) T v; // expected-error {{requested alignment is less than minimum}}
Index: clang/lib/Sema/SemaDeclAttr.cpp
===
--- clang/lib/Sema/SemaDeclAttr.cpp
+++ clang/lib/Sema/SemaDeclAttr.cpp
@@ -4305,6 +4305,9 @@
 } else if (const auto *FD = dyn_cast(D)) {
   if (FD->isBitField())
 DiagKind = 3;
+} else if (const auto *ED = dyn_cast(D)) {
+  if (ED->getLangOpts().CPlusPlus)
+DiagKind = 4;
 } else if (!isa(D)) {
   Diag(AttrLoc, diag::err_attribute_wrong_decl_type) << &TmpAttr
 << (TmpAt

[PATCH] D121723: [clang] CWG 2354: prohibit alignas for enums

2022-03-15 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 415529.
Endill added a comment.

Add a quote from CWG 2354 after a quote from C++11


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121723/new/

https://reviews.llvm.org/D121723

Files:
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
  clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
  clang/test/CXX/drs/dr2354.cpp
  clang/www/cxx_dr_status.html

Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -13938,7 +13938,7 @@
 https://wg21.link/cwg2354";>2354
 CD5
 Extended alignment and object representation
-Unknown
+Clang 15
   
   
 https://wg21.link/cwg2355";>2355
Index: clang/test/CXX/drs/dr2354.cpp
===
--- /dev/null
+++ clang/test/CXX/drs/dr2354.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -x c++ -verify %s 
+
+// dr2354: 15
+
+namespace DR2354 {
+
+enum alignas(64) A {};// expected-error {{'alignas' attribute cannot be applied to an enumeration}}
+enum struct alignas(64) B {}; // expected-error {{'alignas' attribute cannot be applied to an enumeration}}
+
+} // namespace DR2354
Index: clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
===
--- clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
+++ clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p6.cpp
@@ -27,21 +27,6 @@
 int n9; // expected-error {{'alignas' must be specified on definition if it is specified on any declaration}}
 alignas(4) extern int n9; // expected-note {{declared with 'alignas' attribute here}}
 
-
-enum alignas(2) E : char; // expected-note {{declared with 'alignas' attribute here}}
-enum E : char {}; // expected-error {{'alignas' must be specified on definition if it is specified on any declaration}}
-
-enum alignas(4) F : char; // expected-note {{previous declaration is here}}
-enum alignas(2) F : char; // expected-error {{redeclaration has different alignment requirement (2 vs 4)}}
-
-enum G : char;
-enum alignas(8) G : char {};
-enum G : char;
-
-enum H : char {}; // expected-error {{'alignas' must be specified on definition if it is specified on any declaration}}
-enum alignas(1) H : char; // expected-note {{declared with 'alignas' attribute here}}
-
-
 struct S;
 struct alignas(16) S; // expected-note {{declared with 'alignas' attribute here}}
 struct S;
@@ -73,14 +58,5 @@
 char *x1848 = X<1,8,4,8>::Buffer; // ok
 char *x1248 = X<1,2,4,8>::Buffer; // expected-note {{in instantiation of}}
 
-template struct Y {
-  enum alignas(M) alignas(N) E : char;
-};
-template
-enum alignas(O) alignas(P) Y::E : char { e };
-int y1848 = Y<1,8,4,8>::e;
-// FIXME: We should reject this.
-int y1248 = Y<1,2,4,8>::e;
-
 // Don't crash here.
 alignas(4) struct Incomplete incomplete; // expected-error {{incomplete type}} expected-note {{forward declaration}}
Index: clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
===
--- clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
+++ clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p5.cpp
@@ -11,13 +11,6 @@
 alignas(8) int n9 alignas(2); // ok, overaligned
 alignas(1) extern int n10; // expected-error {{less than minimum alignment}}
 
-enum alignas(1) E1 {}; // expected-error {{requested alignment is less than minimum alignment of 4 for type 'E1'}}
-enum alignas(1) E2 : char {}; // ok
-enum alignas(4) E3 { e3 = 0 }; // ok
-enum alignas(4) E4 { e4 = 1ull << 33 }; // expected-error {{requested alignment is less than minimum alignment of 8 for type 'E4'}}
-enum alignas(8) E5 {};
-static_assert(alignof(E5) == 8, "");
-
 typedef __attribute__((aligned(16))) int IntAlign16;
 enum E6 : IntAlign16 {};
 static_assert(alignof(E6) == 4, "");
@@ -62,15 +55,6 @@
 template struct X<16, 8, S1>;
 template struct X<4, 4, S1>; // expected-note {{instantiation}}
 
-template
-struct Y {
-  enum alignas(N) E : T {}; // expected-error {{requested alignment is less than minimum}}
-};
-template struct Y<1, char>;
-template struct Y<2, char>;
-template struct Y<1, short>; // expected-note {{instantiation}}
-template struct Y<2, short>;
-
 template
 void f() {
   alignas(N) T v; // expected-error {{requested alignment is less than minimum}}
Index: clang/lib/Sema/SemaDeclAttr.cpp
===
--- clang/lib/Sema/SemaDeclAttr.cpp
+++ clang/lib/Sema/SemaDeclAttr.cpp
@@ -4290,6 +4290,9 @@
 //   declared with the register storage class specifier. An
 //   alignment-specifier may also be applied to the declaration of a class
 //   or enumeration type.
+// CWG 2354:
+//   CWG agreed to remove permission for alignas to be applied to
+//   enumerations.
 // C11 6.7.5/2:
 //   

[PATCH] D121723: [clang] CWG 2354: prohibit alignas for enums

2022-03-15 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/lib/Sema/SemaDeclAttr.cpp:4291
 //   declared with the register storage class specifier. An
 //   alignment-specifier may also be applied to the declaration of a class
 //   or enumeration type.

erichkeane wrote:
> Can you add a comment up near here updating this?  
Like this? I can also quote the same paragraph from C++20, where this DR is 
already applied.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121723/new/

https://reviews.llvm.org/D121723

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121723: [clang] CWG 2354: prohibit alignas for enums

2022-03-16 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Can somebody commit this? I don't have commit access.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121723/new/

https://reviews.llvm.org/D121723

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121723: [clang] CWG 2354: prohibit alignas for enums

2022-03-16 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

In D121723#3384982 , @ChuanqiXu wrote:

> In D121723#3384962 , @Endill wrote:
>
>> Can somebody commit this? I don't have commit access.
>
> Hi, what's your prefered name and email addressed? I would love to commit it.

Vlad Serebrennikov
serebrennikov.vladis...@gmail.com


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121723/new/

https://reviews.llvm.org/D121723

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142381: [clang] Add test for CWG1960

2023-01-26 Thread Vlad Serebrennikov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG839eae38a4e4: [clang] Add test for CWG1960 (authored by 
Endill).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142381/new/

https://reviews.llvm.org/D142381

Files:
  clang/test/CXX/drs/dr19xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -11567,7 +11567,7 @@
 https://wg21.link/cwg1960";>1960
 NAD
 Visibility of entity named in class-scope using-declaration
-Unknown
+No
   
   
 https://wg21.link/cwg1961";>1961
Index: clang/test/CXX/drs/dr19xx.cpp
===
--- clang/test/CXX/drs/dr19xx.cpp
+++ clang/test/CXX/drs/dr19xx.cpp
@@ -167,6 +167,27 @@
 #endif
 }
 
+namespace dr1960 { // dr1960: no
+struct A {
+void f() {}
+protected:
+void g() {}
+};
+
+struct B: A {
+private:
+using A::f;
+using A::g;
+};
+
+struct C : B {
+// FIXME: both declarations are ill-formed, because A::f and A::g
+// are not accessible.
+using A::f;
+using A::g;
+};
+}
+
 namespace dr1966 { // dr1966: 11
 #if __cplusplus >= 201103L
   struct A {


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -11567,7 +11567,7 @@
 https://wg21.link/cwg1960";>1960
 NAD
 Visibility of entity named in class-scope using-declaration
-Unknown
+No
   
   
 https://wg21.link/cwg1961";>1961
Index: clang/test/CXX/drs/dr19xx.cpp
===
--- clang/test/CXX/drs/dr19xx.cpp
+++ clang/test/CXX/drs/dr19xx.cpp
@@ -167,6 +167,27 @@
 #endif
 }
 
+namespace dr1960 { // dr1960: no
+struct A {
+void f() {}
+protected:
+void g() {}
+};
+
+struct B: A {
+private:
+using A::f;
+using A::g;
+};
+
+struct C : B {
+// FIXME: both declarations are ill-formed, because A::f and A::g
+// are not accessible.
+using A::f;
+using A::g;
+};
+}
+
 namespace dr1966 { // dr1966: 11
 #if __cplusplus >= 201103L
   struct A {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142315: [clang] Add test for CWG1111

2023-01-26 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 492395.
Endill added a comment.

Change status from "6" to "yes" since "ambiguous-member-template" warning is a 
false-positive now.

- Disable "ambiguous-member-template" diagnostic in 98 and 03 modes
- Add an example (`struct A`)
- Apply clang-format


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142315/new/

https://reviews.llvm.org/D142315

Files:
  clang/test/CXX/drs/dr11xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -6473,7 +6473,7 @@
 https://wg21.link/cwg";>
 C++11
 Remove dual-scope lookup of member template names
-Unknown
+Yes
   
   
 https://wg21.link/cwg1112";>1112
Index: clang/test/CXX/drs/dr11xx.cpp
===
--- clang/test/CXX/drs/dr11xx.cpp
+++ clang/test/CXX/drs/dr11xx.cpp
@@ -4,6 +4,46 @@
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 
+namespace dr { // dr: yes
+namespace example1 {
+template  struct set;
+
+struct X {
+  template  void set(const T &value);
+};
+void foo() {
+  X x;
+#pragma clang diagnostic push
+#if __cplusplus < 201103L
+#pragma clang diagnostic ignored "-Wambiguous-member-template"
+#endif
+  x.set(3.2);
+#pragma clang diagnostic pop
+}
+
+struct Y {};
+void bar() {
+  Y y;
+  y.set(3.2); // expected-error {{no member named 'set' in 
'dr::example1::Y'}}
+}
+} // namespace example1
+
+namespace example2 {
+struct A {};
+namespace N {
+struct A {
+  void g() {}
+  template  operator T();
+};
+} // namespace N
+
+void baz() {
+  N::A a;
+  a.operator A();
+}
+} // namespace example2
+} // namespace dr
+
 namespace dr1113 { // dr1113: partial
   namespace named {
 extern int a; // expected-note {{previous}}


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -6473,7 +6473,7 @@
 https://wg21.link/cwg";>
 C++11
 Remove dual-scope lookup of member template names
-Unknown
+Yes
   
   
 https://wg21.link/cwg1112";>1112
Index: clang/test/CXX/drs/dr11xx.cpp
===
--- clang/test/CXX/drs/dr11xx.cpp
+++ clang/test/CXX/drs/dr11xx.cpp
@@ -4,6 +4,46 @@
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
+namespace dr { // dr: yes
+namespace example1 {
+template  struct set;
+
+struct X {
+  template  void set(const T &value);
+};
+void foo() {
+  X x;
+#pragma clang diagnostic push
+#if __cplusplus < 201103L
+#pragma clang diagnostic ignored "-Wambiguous-member-template"
+#endif
+  x.set(3.2);
+#pragma clang diagnostic pop
+}
+
+struct Y {};
+void bar() {
+  Y y;
+  y.set(3.2); // expected-error {{no member named 'set' in 'dr::example1::Y'}}
+}
+} // namespace example1
+
+namespace example2 {
+struct A {};
+namespace N {
+struct A {
+  void g() {}
+  template  operator T();
+};
+} // namespace N
+
+void baz() {
+  N::A a;
+  a.operator A();
+}
+} // namespace example2
+} // namespace dr
+
 namespace dr1113 { // dr1113: partial
   namespace named {
 extern int a; // expected-note {{previous}}
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142315: [clang] Add test for CWG1111

2023-01-26 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr11xx.cpp:1
-// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++98 %s -verify=expected,cxx98 -fexceptions 
-fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors

erichkeane wrote:
> I see what happened now: Add `-Wno-error=ambiguous-member-template` to this 
> line.
Thank you for suggestion, but I'd like to avoid making changes that could 
affect other tests (now and in the future), so I went pragma way.



Comment at: clang/test/CXX/drs/dr11xx.cpp:31
+  }
+}
+

Endill wrote:
> erichkeane wrote:
> > Can you also add the last example (with struct A) from the issue, and find 
> > a way to confirm that it is calling the right version?
> Nice catch, thank you. Long exposure to P1787 makes one pay less attention to 
> resolutions in CWG issues, it seems :)
Done!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142315/new/

https://reviews.llvm.org/D142315

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142315: [clang] Add test for CWG1111

2023-01-26 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 492430.
Endill edited the summary of this revision.
Endill added a comment.

Move CWG2385 ("na") from D142316  into this 
patch. It makes more sense to put it here, because it fixes inconsistent 
wording introduced by CWG resolution.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142315/new/

https://reviews.llvm.org/D142315

Files:
  clang/test/CXX/drs/dr11xx.cpp
  clang/test/CXX/drs/dr23xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -6473,7 +6473,7 @@
 https://wg21.link/cwg";>
 C++11
 Remove dual-scope lookup of member template names
-Unknown
+Yes
   
   
 https://wg21.link/cwg1112";>1112
@@ -14117,7 +14117,7 @@
 https://wg21.link/cwg2385";>2385
 CD5
 Lookup for conversion-function-ids
-Unknown
+N/A
   
   
 https://wg21.link/cwg2386";>2386
Index: clang/test/CXX/drs/dr23xx.cpp
===
--- clang/test/CXX/drs/dr23xx.cpp
+++ clang/test/CXX/drs/dr23xx.cpp
@@ -169,6 +169,8 @@
 } //namespace dr2303
 #endif
 
+// dr2385: na
+
 namespace dr2394 { // dr2394: 15
 
 struct A {};
Index: clang/test/CXX/drs/dr11xx.cpp
===
--- clang/test/CXX/drs/dr11xx.cpp
+++ clang/test/CXX/drs/dr11xx.cpp
@@ -4,6 +4,46 @@
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 
+namespace dr { // dr: yes
+namespace example1 {
+template  struct set;
+
+struct X {
+  template  void set(const T &value);
+};
+void foo() {
+  X x;
+#pragma clang diagnostic push
+#if __cplusplus < 201103L
+#pragma clang diagnostic ignored "-Wambiguous-member-template"
+#endif
+  x.set(3.2);
+#pragma clang diagnostic pop
+}
+
+struct Y {};
+void bar() {
+  Y y;
+  y.set(3.2); // expected-error {{no member named 'set' in 
'dr::example1::Y'}}
+}
+} // namespace example1
+
+namespace example2 {
+struct A {};
+namespace N {
+struct A {
+  void g() {}
+  template  operator T();
+};
+} // namespace N
+
+void baz() {
+  N::A a;
+  a.operator A();
+}
+} // namespace example2
+} // namespace dr
+
 namespace dr1113 { // dr1113: partial
   namespace named {
 extern int a; // expected-note {{previous}}


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -6473,7 +6473,7 @@
 https://wg21.link/cwg";>
 C++11
 Remove dual-scope lookup of member template names
-Unknown
+Yes
   
   
 https://wg21.link/cwg1112";>1112
@@ -14117,7 +14117,7 @@
 https://wg21.link/cwg2385";>2385
 CD5
 Lookup for conversion-function-ids
-Unknown
+N/A
   
   
 https://wg21.link/cwg2386";>2386
Index: clang/test/CXX/drs/dr23xx.cpp
===
--- clang/test/CXX/drs/dr23xx.cpp
+++ clang/test/CXX/drs/dr23xx.cpp
@@ -169,6 +169,8 @@
 } //namespace dr2303
 #endif
 
+// dr2385: na
+
 namespace dr2394 { // dr2394: 15
 
 struct A {};
Index: clang/test/CXX/drs/dr11xx.cpp
===
--- clang/test/CXX/drs/dr11xx.cpp
+++ clang/test/CXX/drs/dr11xx.cpp
@@ -4,6 +4,46 @@
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
+namespace dr { // dr: yes
+namespace example1 {
+template  struct set;
+
+struct X {
+  template  void set(const T &value);
+};
+void foo() {
+  X x;
+#pragma clang diagnostic push
+#if __cplusplus < 201103L
+#pragma clang diagnostic ignored "-Wambiguous-member-template"
+#endif
+  x.set(3.2);
+#pragma clang diagnostic pop
+}
+
+struct Y {};
+void bar() {
+  Y y;
+  y.set(3.2); // expected-error {{no member named 'set' in 'dr::example1::Y'}}
+}
+} // namespace example1
+
+namespace example2 {
+struct A {};
+namespace N {
+struct A {
+  void g() {}
+  template  operator T();
+};
+} // namespace N
+
+void baz() {
+  N::A a;
+  a.operator A();
+}
+} // namespace example2
+} // namespace dr
+
 namespace dr1113 { // dr1113: partial
   namespace named {
 extern int a; // expected-note {{previous}}
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142316: [clang] Add test for CWG2396

2023-01-26 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 492433.
Endill edited the summary of this revision.
Endill added a comment.

Move CWG2385 out to D142315 , because it's 
been resolved prior to P1787 , and it's easier 
to explain it there.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142316/new/

https://reviews.llvm.org/D142316

Files:
  clang/test/CXX/drs/dr12xx.cpp
  clang/test/CXX/drs/dr23xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -7553,7 +7553,7 @@
 https://wg21.link/cwg1291";>1291
 CD6
 Looking up a conversion-type-id
-Unknown
+N/A
   
   
 https://wg21.link/cwg1292";>1292
@@ -14183,7 +14183,7 @@
 https://wg21.link/cwg2396";>2396
 CD6
 Lookup of names in complex conversion-type-ids
-Unknown
+No
   
   
 https://wg21.link/cwg2397";>2397
Index: clang/test/CXX/drs/dr23xx.cpp
===
--- clang/test/CXX/drs/dr23xx.cpp
+++ clang/test/CXX/drs/dr23xx.cpp
@@ -179,3 +179,26 @@
 B b;
 
 }
+
+namespace dr2396 { // dr2396: no
+  template
+  struct identity {
+typedef T type;
+  };
+
+  struct A {
+struct B;
+operator B B::*();
+  };
+  struct B;
+
+  // FIXME: per P1787 "Calling a conversion function" example, all of the
+  // examples below are well-formed, with B resolving to A::B, but currently
+  // it's been resolved to dr2396::B. 
+
+  // void f(A a) { a.operator B B::*(); }
+  // void g(A a) { a.operator decltype(B()) B::*(); }
+  // void g2(A a) { a.operator B decltype(B())::*(); }
+  // void h(A a) { a.operator identity::type B::*(); }  
+  // void h2(A a) { a.operator B identity::type::*(); } 
+}
Index: clang/test/CXX/drs/dr12xx.cpp
===
--- clang/test/CXX/drs/dr12xx.cpp
+++ clang/test/CXX/drs/dr12xx.cpp
@@ -68,6 +68,8 @@
 #endif
 }
 
+// dr1291: na
+
 namespace dr1295 { // dr1295: 4
   struct X {
 unsigned bitfield : 4;


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -7553,7 +7553,7 @@
 https://wg21.link/cwg1291";>1291
 CD6
 Looking up a conversion-type-id
-Unknown
+N/A
   
   
 https://wg21.link/cwg1292";>1292
@@ -14183,7 +14183,7 @@
 https://wg21.link/cwg2396";>2396
 CD6
 Lookup of names in complex conversion-type-ids
-Unknown
+No
   
   
 https://wg21.link/cwg2397";>2397
Index: clang/test/CXX/drs/dr23xx.cpp
===
--- clang/test/CXX/drs/dr23xx.cpp
+++ clang/test/CXX/drs/dr23xx.cpp
@@ -179,3 +179,26 @@
 B b;
 
 }
+
+namespace dr2396 { // dr2396: no
+  template
+  struct identity {
+typedef T type;
+  };
+
+  struct A {
+struct B;
+operator B B::*();
+  };
+  struct B;
+
+  // FIXME: per P1787 "Calling a conversion function" example, all of the
+  // examples below are well-formed, with B resolving to A::B, but currently
+  // it's been resolved to dr2396::B. 
+
+  // void f(A a) { a.operator B B::*(); }
+  // void g(A a) { a.operator decltype(B()) B::*(); }
+  // void g2(A a) { a.operator B decltype(B())::*(); }
+  // void h(A a) { a.operator identity::type B::*(); }  
+  // void h2(A a) { a.operator B identity::type::*(); } 
+}
Index: clang/test/CXX/drs/dr12xx.cpp
===
--- clang/test/CXX/drs/dr12xx.cpp
+++ clang/test/CXX/drs/dr12xx.cpp
@@ -68,6 +68,8 @@
 #endif
 }
 
+// dr1291: na
+
 namespace dr1295 { // dr1295: 4
   struct X {
 unsigned bitfield : 4;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142316: [clang] Add test for CWG2396

2023-01-27 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr23xx.cpp:202
+  // void g2(A a) { a.operator B decltype(B())::*(); }
+  // void h(A a) { a.operator identity::type B::*(); }  
+  // void h2(A a) { a.operator B identity::type::*(); } 

shafik wrote:
> While gcc accepts the first three it does not like the last two: 
> https://godbolt.org/z/js8Pz14Eo
> 
> I believe they should also be covered but not confident.
I agree they should. I can't find any special considerations in the standard 
regarding unqualified name lookup of template arguments.

Are there any action items for me here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142316/new/

https://reviews.llvm.org/D142316

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142717: [clang] Mark CWG2165 as N/A

2023-01-27 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : "CWG2165 is resolved by removing the 
conflicting definition of it in [basic.scope]."
Wording: [basic.namespace]/p1 changed and [basic.scope.declarative] removed 
entirely


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142717

Files:
  clang/test/CXX/drs/dr21xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -12797,7 +12797,7 @@
 https://wg21.link/cwg2165";>2165
 CD6
 Namespaces, declarative regions, and translation units
-Unknown
+N/A
   
   
 https://wg21.link/cwg2166";>2166
Index: clang/test/CXX/drs/dr21xx.cpp
===
--- clang/test/CXX/drs/dr21xx.cpp
+++ clang/test/CXX/drs/dr21xx.cpp
@@ -127,6 +127,8 @@
 #endif
 }
 
+// dr2165: na
+
 namespace dr2170 { // dr2170: 9
 #if __cplusplus >= 201103L
   void f() {


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -12797,7 +12797,7 @@
 https://wg21.link/cwg2165";>2165
 CD6
 Namespaces, declarative regions, and translation units
-Unknown
+N/A
   
   
 https://wg21.link/cwg2166";>2166
Index: clang/test/CXX/drs/dr21xx.cpp
===
--- clang/test/CXX/drs/dr21xx.cpp
+++ clang/test/CXX/drs/dr21xx.cpp
@@ -127,6 +127,8 @@
 #endif
 }
 
+// dr2165: na
+
 namespace dr2170 { // dr2170: 9
 #if __cplusplus >= 201103L
   void f() {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142315: [clang] Add test for CWG1111

2023-01-22 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142315

Files:
  clang/test/CXX/drs/dr11xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -6473,7 +6473,7 @@
 https://wg21.link/cwg";>
 C++11
 Remove dual-scope lookup of member template names
-Unknown
+Clang 6
   
   
 https://wg21.link/cwg1112";>1112
Index: clang/test/CXX/drs/dr11xx.cpp
===
--- clang/test/CXX/drs/dr11xx.cpp
+++ clang/test/CXX/drs/dr11xx.cpp
@@ -1,9 +1,35 @@
-// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++98 %s -verify=expected,cxx98 -fexceptions 
-fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 
+namespace dr { // dr: 6
+  // FIXME: warning is emitted for well-formed code in C++98 mode, which
+  // follows the old behavior (clang 5 and earlier). Behavior is correct in all
+  // modes, though: only candidates from the class of the object expression are
+  // considered.
+
+  template
+  struct set; // #dr-set-template
+
+  struct X {
+template  void set(const T& value); // #dr-set-member
+  };
+  void foo() {
+X x;
+x.set(3.2); // cxx98-error {{lookup of 'set' in member access 
expression is ambiguous; using member of 'X'}}
+// cxx98-note@#dr-set-member {{lookup in the object type 'X' refers 
here}}
+// cxx98-note@#dr-set-template {{lookup from the current scope refers 
here}}
+  }
+
+  struct Y {};
+  void bar() {
+Y y;
+y.set(3.2); // expected-error {{no member named 'set' in 
'dr::Y'}}
+  }
+}
+
 namespace dr1113 { // dr1113: partial
   namespace named {
 extern int a; // expected-note {{previous}}


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -6473,7 +6473,7 @@
 https://wg21.link/cwg";>
 C++11
 Remove dual-scope lookup of member template names
-Unknown
+Clang 6
   
   
 https://wg21.link/cwg1112";>1112
Index: clang/test/CXX/drs/dr11xx.cpp
===
--- clang/test/CXX/drs/dr11xx.cpp
+++ clang/test/CXX/drs/dr11xx.cpp
@@ -1,9 +1,35 @@
-// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++98 %s -verify=expected,cxx98 -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
+namespace dr { // dr: 6
+  // FIXME: warning is emitted for well-formed code in C++98 mode, which
+  // follows the old behavior (clang 5 and earlier). Behavior is correct in all
+  // modes, though: only candidates from the class of the object expression are
+  // considered.
+
+  template
+  struct set; // #dr-set-template
+
+  struct X {
+template  void set(const T& value); // #dr-set-member
+  };
+  void foo() {
+X x;
+x.set(3.2); // cxx98-error {{lookup of 'set' in member access expression is ambiguous; using member of 'X'}}
+// cxx98-note@#dr-set-member {{lookup in the object type 'X' refers here}}
+// cxx98-note@#dr-set-template {{lookup from the current scope refers here}}
+  }
+
+  struct Y {};
+  void bar() {
+Y y;
+y.set(3.2); // expected-error {{no member named 'set' in 'dr::Y'}}
+  }
+}
+
 namespace dr1113 { // dr1113: partial
   namespace named {
 extern int a; // expected-note {{previous}}
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142316: [clang] Add test for CWG2396

2023-01-22 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Also mark CWG1291 and CWG2385 as "na".

P1787 : CWG1291 and CWG2396 are resolved by 
explicitly specifying how to look up names in a conversion-type-id.
Wording: see changes to [basic.lookup.unqual]/5 and [basic.lookup.qual]/2.

"Calling a conversion function" example in P1787 
 is also relevant.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142316

Files:
  clang/test/CXX/drs/dr12xx.cpp
  clang/test/CXX/drs/dr23xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -7553,7 +7553,7 @@
 https://wg21.link/cwg1291";>1291
 CD6
 Looking up a conversion-type-id
-Unknown
+N/A
   
   
 https://wg21.link/cwg1292";>1292
@@ -14117,7 +14117,7 @@
 https://wg21.link/cwg2385";>2385
 CD5
 Lookup for conversion-function-ids
-Unknown
+N/A
   
   
 https://wg21.link/cwg2386";>2386
@@ -14183,7 +14183,7 @@
 https://wg21.link/cwg2396";>2396
 CD6
 Lookup of names in complex conversion-type-ids
-Unknown
+No
   
   
 https://wg21.link/cwg2397";>2397
Index: clang/test/CXX/drs/dr23xx.cpp
===
--- clang/test/CXX/drs/dr23xx.cpp
+++ clang/test/CXX/drs/dr23xx.cpp
@@ -169,6 +169,8 @@
 } //namespace dr2303
 #endif
 
+// dr2385: na
+
 namespace dr2394 { // dr2394: 15
 
 struct A {};
@@ -179,3 +181,26 @@
 B b;
 
 }
+
+namespace dr2396 { // dr2396: no
+  template
+  struct identity {
+typedef T type;
+  };
+
+  struct A {
+struct B;
+operator B B::*();
+  };
+  struct B;
+
+  // FIXME: per P1787 "Calling a conversion function" example, all of the
+  // examples below are well-formed, with B resolving to A::B, but currently
+  // it's been resolved to dr2396::B. 
+
+  // void f(A a) { a.operator B B::*(); }
+  // void g(A a) { a.operator decltype(B()) B::*(); }
+  // void g2(A a) { a.operator B decltype(B())::*(); }
+  // void h(A a) { a.operator identity::type B::*(); }  
+  // void h2(A a) { a.operator B identity::type::*(); } 
+}
Index: clang/test/CXX/drs/dr12xx.cpp
===
--- clang/test/CXX/drs/dr12xx.cpp
+++ clang/test/CXX/drs/dr12xx.cpp
@@ -68,6 +68,8 @@
 #endif
 }
 
+// dr1291: na
+
 namespace dr1295 { // dr1295: 4
   struct X {
 unsigned bitfield : 4;


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -7553,7 +7553,7 @@
 https://wg21.link/cwg1291";>1291
 CD6
 Looking up a conversion-type-id
-Unknown
+N/A
   
   
 https://wg21.link/cwg1292";>1292
@@ -14117,7 +14117,7 @@
 https://wg21.link/cwg2385";>2385
 CD5
 Lookup for conversion-function-ids
-Unknown
+N/A
   
   
 https://wg21.link/cwg2386";>2386
@@ -14183,7 +14183,7 @@
 https://wg21.link/cwg2396";>2396
 CD6
 Lookup of names in complex conversion-type-ids
-Unknown
+No
   
   
 https://wg21.link/cwg2397";>2397
Index: clang/test/CXX/drs/dr23xx.cpp
===
--- clang/test/CXX/drs/dr23xx.cpp
+++ clang/test/CXX/drs/dr23xx.cpp
@@ -169,6 +169,8 @@
 } //namespace dr2303
 #endif
 
+// dr2385: na
+
 namespace dr2394 { // dr2394: 15
 
 struct A {};
@@ -179,3 +181,26 @@
 B b;
 
 }
+
+namespace dr2396 { // dr2396: no
+  template
+  struct identity {
+typedef T type;
+  };
+
+  struct A {
+struct B;
+operator B B::*();
+  };
+  struct B;
+
+  // FIXME: per P1787 "Calling a conversion function" example, all of the
+  // examples below are well-formed, with B resolving to A::B, but currently
+  // it's been resolved to dr2396::B. 
+
+  // void f(A a) { a.operator B B::*(); }
+  // void g(A a) { a.operator decltype(B()) B::*(); }
+  // void g2(A a) { a.operator B decltype(B())::*(); }
+  // void h(A a) { a.operator identity::type B::*(); }  
+  // void h2(A a) { a.operator B identity::type::*(); } 
+}
Index: clang/test/CXX/drs/dr12xx.cpp
===
--- clang/test/CXX/drs/dr12xx.cpp
+++ clang/test/CXX/drs/dr12xx.cpp
@@ -68,6 +68,8 @@
 #endif
 }
 
+// dr1291: na
+
 namespace dr1295 { // dr1295: 4
   struct X {
 unsigned bitfield : 4;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139326: [clang] Add test for CWG952

2023-01-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr9xx.cpp:76
+namespace dr952 { // dr952: yes
+struct A {
+  typedef int I; // #dr952-typedef-decl

aaron.ballman wrote:
> I wouldn't mind another test case:
> ```
> struct A {
> protected:
>   static int x;
> };
> struct B : A {
>   friend int get(B) { return x; }
> };
> ```
> this was something Richard had pointed out needs to still work as part of the 
> reflector discussions of this issue.
Sorry, it seems I missed your comment when I landed the patch. Would it be fine 
to add this test as NFC patch?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139326/new/

https://reviews.llvm.org/D139326

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142315: [clang] Add test for CWG1111

2023-01-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/www/cxx_dr_status.html:6476
 Remove dual-scope lookup of member template names
-Unknown
+Clang 6
   

shafik wrote:
> aaron.ballman wrote:
> > erichkeane wrote:
> > > Were you able to track down which patch fixed this in clang 6?
> > > 
> > > I also don't think we can mark this as 'full' support, if its still 
> > > broken in C++98.  Unless we can find a good reason this wasn't/wont be 
> > > done for C++98 as well, I don't know if we can mark this as 'done'.
> > We can mark it as `partial` and put the reason in the details. I'm not 
> > certain if the python script has a way to do that easily or not.
> I think this might be related as well: 
> https://github.com/llvm/llvm-project/issues/59910
> Were you able to track down which patch fixed this in clang 6?
I haven't even tried, since I don't intend to fix this for now.

> We can mark it as partial and put the reason in the details.
Is false-positive //warning// enough to degrade `full` to `partial` despite the 
correct behavior? Just confirming here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142315/new/

https://reviews.llvm.org/D142315

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142315: [clang] Add test for CWG1111

2023-01-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

In D142315#4073782 , @erichkeane 
wrote:

> I didn't internalize that it was 'just a warning' (it was a -error in the 
> test above), we should have a task for someone to remove that warning as it 
> is no longer ambiguous.  But I don't think it makes it 'partial' here anymore.

It is an error, because `-pedantic-errors` is enabled across DR test suite. I 
wonder why, given that even notes can't escape `-verify` mode unhandled.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142315/new/

https://reviews.llvm.org/D142315

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142315: [clang] Add test for CWG1111

2023-01-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr11xx.cpp:31
+  }
+}
+

erichkeane wrote:
> Can you also add the last example (with struct A) from the issue, and find a 
> way to confirm that it is calling the right version?
Nice catch, thank you. Long exposure to P1787 makes one pay less attention to 
resolutions in CWG issues, it seems :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142315/new/

https://reviews.llvm.org/D142315

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142381: [clang] Add test for CWG1960

2023-01-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : "CWG1960 (currently closed as NAD) is 
resolved by removing the rule in question (which is widely ignored by 
implementations and gives subtle interactions between using-declarations)."
Wording: "In a using-declarator that does not name a constructor, every 
declaration named shall be accessible."


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142381

Files:
  clang/test/CXX/drs/dr19xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -11567,7 +11567,7 @@
 https://wg21.link/cwg1960";>1960
 NAD
 Visibility of entity named in class-scope using-declaration
-Unknown
+No
   
   
 https://wg21.link/cwg1961";>1961
Index: clang/test/CXX/drs/dr19xx.cpp
===
--- clang/test/CXX/drs/dr19xx.cpp
+++ clang/test/CXX/drs/dr19xx.cpp
@@ -167,6 +167,27 @@
 #endif
 }
 
+namespace dr1960 { // dr1960: no
+struct A {
+void f() {}
+protected:
+void g() {}
+};
+
+struct B: A {
+private:
+using A::f;
+using A::g;
+};
+
+struct C : B {
+// FIXME: both declarations are ill-formed, because A::f and A::g
+// are not accessible.
+using A::f;
+using A::g;
+};
+}
+
 namespace dr1966 { // dr1966: 11
 #if __cplusplus >= 201103L
   struct A {


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -11567,7 +11567,7 @@
 https://wg21.link/cwg1960";>1960
 NAD
 Visibility of entity named in class-scope using-declaration
-Unknown
+No
   
   
 https://wg21.link/cwg1961";>1961
Index: clang/test/CXX/drs/dr19xx.cpp
===
--- clang/test/CXX/drs/dr19xx.cpp
+++ clang/test/CXX/drs/dr19xx.cpp
@@ -167,6 +167,27 @@
 #endif
 }
 
+namespace dr1960 { // dr1960: no
+struct A {
+void f() {}
+protected:
+void g() {}
+};
+
+struct B: A {
+private:
+using A::f;
+using A::g;
+};
+
+struct C : B {
+// FIXME: both declarations are ill-formed, because A::f and A::g
+// are not accessible.
+using A::f;
+using A::g;
+};
+}
+
 namespace dr1966 { // dr1966: 11
 #if __cplusplus >= 201103L
   struct A {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142377: Dead links on https://clang.llvm.org/extra/clang-tidy/ #60023

2023-01-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

LGTM
I checked clang-tidy docs for this kind of broken references, but found nothing 
else.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142377/new/

https://reviews.llvm.org/D142377

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142316: [clang] Add test for CWG2396

2023-01-24 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

In D142316#4073771 , @shafik wrote:

> You mention CWG2385  as na but you don't explain 
> how it was resolved, was it superceded by p1787 
> .

CWG2385 points out to inconsistency in wording introduced by resolution of 
CWG, so I consider it a pure wording change. This issue, as well as 
aforementioned CWG, were resolved independently of P1787 
, hence I didn't provide any explanation for 
them.

In D142316#4073771 , @shafik wrote:

> Also nitpick you mentioned `P1787` in the description but it links to a phab 
> review, you should probably just use a link like I did above to refer to 
> papers. Same with the defect reports also like I did above. Folks may not 
> know how to find defect reports and or papers.

I felt that it's going to worsen the readability of raw commit messages, but I 
can indeed use markdown links if it helps.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142316/new/

https://reviews.llvm.org/D142316

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D140828: [C++] Implement "Deducing this" (P0847R7)

2023-10-02 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/docs/ReleaseNotes.rst:94-98
+- Implemented `P0847R7: Deducing this `. Some 
related core issues were also
+  implemented (`CWG2553 `, `CWG2554 
`,
+  `CWG2653 `, `CWG2687 
`).
+  Because the support for this feature is still experimental, the feature test 
macro ``__cpp_explicit_this_parameter``
+  was not set in this version.

aaron.ballman wrote:
> 
Closing words `was not set in this version.` have been lost.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140828/new/

https://reviews.llvm.org/D140828

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D156057: [Clang][Sema] Diagnose indeterminately sequenced accesses

2023-07-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Thank you for working on this!




Comment at: clang/test/SemaCXX/warn-unsequenced.cpp:3
 // RUN:-Wunsequenced -Wno-c++17-extensions -Wno-c++14-extensions %s
-// RUN: %clang_cc1 -fsyntax-only -verify=cxx17 -std=c++17 -Wno-unused 
-Wno-uninitialized \
-// RUN:-Wunsequenced -Wno-c++17-extensions -Wno-c++14-extensions %s
+// RUN: %clang_cc1 -fsyntax-only -verify=cxx17 -std=c++23 -Wno-unused 
-Wno-uninitialized \
+// RUN:-Wunsequenced %s

Checking for `cxx17` prefix in C++23 mode is misleading. I suggest to rename is 
to `since-cxx17`, and have a new run line for C++23 mode, leaving check in 
C++17 mode intact.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156057/new/

https://reviews.llvm.org/D156057

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D156057: [Clang][Sema] Diagnose indeterminately sequenced accesses

2023-07-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

I'm sorry for hand-waving, but I also remember @aaron.ballman saying that code 
related to `-Wunsequenced` or around it was missing checks for C++17.
I can't say whether you addressed that or not, so just leaving it here for you 
and reviewers.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156057/new/

https://reviews.llvm.org/D156057

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D156057: [Clang][Sema] Diagnose indeterminately sequenced accesses

2023-07-24 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

In D156057#4527787 , @rZhBoYao wrote:

> BTW, I am not sure if CWG2571  is implemented by 
> @cor3ntin? If so, can we mark it as done on 
> https://clang.llvm.org/cxx_dr_status.html#2571? This patch handles the 
> warning around it tho.

As a reminder, we don't change `cxx_dr_status.html` directly. Instead, we add a 
special comment in `clang/test/CXX/drs/dr25xx.cpp` (for the case of CWG2571), 
which should be accompanied by test case(s) if possible. You can follow the 
pattern of existing tests. After that `clang/www/make_cxx_dr_status` script 
should be run to update the HTML.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156057/new/

https://reviews.llvm.org/D156057

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D156565: Diagnose use of VLAs in C++ by default

2023-08-11 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

In D156565#4547909 , @aaron.ballman 
wrote:

> In D156565#4543503 , @aaron.ballman 
> wrote:
>
>> In D156565#4543414 , @jrtc27 wrote:
>>
>>> Given GCC defines GNU C++ and regards this as a feature (unless you use 
>>> things like -pedantic to ask for ISO C++), does it make sense to enable 
>>> this for GNU C++?
>>
>> I think GCC should enable -Wvla by default in GNU C++ as well, for the same 
>> reasons I'm proposing it for Clang. I've filed an issue for it at 
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110848
>
> The GCC conversation is leaning towards only diagnosing by default in C++ 
> mode but not in GNU++ mode. I'm still trying to persuade them to diagnose in 
> both modes one last time, but if it looks like they're firm about not 
> diagnosing in GNU++ mode, I can live with that (for now). It at least 
> improves our security posture a bit, so it's definitely a win.

I think that we should warn by default in GNU mode regardless of GCC decision. 
As for the porting concern, I think it falls into "comprehensive diagnostics" 
selling point you mentioned earlier, which I totally agree with.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156565/new/

https://reviews.llvm.org/D156565

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D157201: [Clang] Support qualified name as member designator in offsetof

2023-08-20 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/SemaCXX/offsetof.cpp:106
+int x3[__builtin_offsetof(struct X2, X2::static_a) == 0 ? 1 : -1]; // 
expected-error{{no member named 'static_a'}}
+int x4[__builtin_offsetof(struct X2, X2::X2) == 0 ? 1 : -1]; // 
expected-error{{no member named 'X2'}}
+

yichi170 wrote:
> cor3ntin wrote:
> > yichi170 wrote:
> > > cor3ntin wrote:
> > > > yichi170 wrote:
> > > > > hubert.reinterpretcast wrote:
> > > > > > aaron.ballman wrote:
> > > > > > > yichi170 wrote:
> > > > > > > > aaron.ballman wrote:
> > > > > > > > > There's one more test I'd like to see:
> > > > > > > > > ```
> > > > > > > > > struct S {
> > > > > > > > >   int Foo;
> > > > > > > > > };
> > > > > > > > > 
> > > > > > > > > template 
> > > > > > > > > void func() {
> > > > > > > > >   static_assert(__builtin_offsetof(Ty, Ty::Foo) == 0, "");
> > > > > > > > > }
> > > > > > > > > 
> > > > > > > > > void inst() {
> > > > > > > > >   func();
> > > > > > > > > }
> > > > > > > > > ```
> > > > > > > > It would get the compile error in the current patch, but I 
> > > > > > > > think it should be compiled without any error, right?
> > > > > > > Correct, that should be accepted: https://godbolt.org/z/1f6a9Yaxa
> > > > > > Should expect this to pass too:
> > > > > > ```
> > > > > > template 
> > > > > > struct Z {
> > > > > >   static_assert(!__builtin_offsetof(T, template Q::x));
> > > > > > };
> > > > > > 
> > > > > > struct A {
> > > > > >   template  using Q = T;
> > > > > >   int x;
> > > > > > };
> > > > > > 
> > > > > > Z za;
> > > > > > ```
> > > > > Wow. Does it mean we cannot simply parse the identifier, `::`, `.` 
> > > > > and brackets in `__builtin_offsetof`?
> > > > GCC seems to support that. 
> > > > 
> > > > We probably want to call `ParseOptionalCXXScopeSpecifier` and store the 
> > > > `NestedNameSpecifierLoc` we'd get from it (and then parse the (sequence 
> > > > of) identifier(s) corresponding to the member) as we do now.
> > > > 
> > > > The documentation of 
> > > > https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Offsetof.html#index-_005f_005fbuiltin_005foffsetof
> > > >  
> > > > seems inaccurate,
> > > > 
> > > > it seems to be
> > > > 
> > > > `"__builtin_offsetof" "(" typename ","  nested-name-specifier 
> > > > offsetof_member_designator ")"`
> > > > 
> > > > 
> > > > Note that you will have to take care of transforming the nested name in 
> > > > TreeTransform and handle type dependencies. Let me know if you have 
> > > > further questions,
> > > > it's more involved than what you signed for. Sorry for not spotting 
> > > > that earlier (Thanks @hubert.reinterpretcast !)
> > > Thank you for all the help! I'll take a look at it!
> > I was wrong, we need another approach.
> > 
> > I think the grammar is actually
> > ```
> > member-designator:
> >   qualified-id
> >   member-designator.qualified-id
> >   member-designator.qualified-id
> > ```
> > IE, we should support https://godbolt.org/z/eEq8snMc8
> > 
> > Unfortunately, this looks like a much bigger change that we envisioned when 
> > we tagged this as a good first issue, to the extent I'm not sure what is 
> > actually the right design is would be.
> > 
> > For each component I imagine we want to store
> > `NestedNameSpecifierLoc + DeclarationNameInfo`
> > 
> > The parser would have to produce a CXXScopeSpec + UnqualifiedId pair for 
> > each component.
> > 
> > The expression is dependent if any of the component is type dependent,
> > 
> > `OffsetOfNode` would have to change, but i think we can get away
> > Only changing the identifier case (ie the dependent case)  
> > 
> Would it be better for me to close this patch and submit a new one if I find 
> out how to implement it? I hope others won't hesitate to contribute because 
> I'm working on this. I don't want to cause any delays in the release plan!
> Would it be better for me to close this patch and submit a new one if I find 
> out how to implement it?
A possible approach is to follow the example of member reference expression in 
its dot form.

> I hope others won't hesitate to contribute because I'm working on this. I 
> don't want to cause any delays in the release plan!
No worries, 17 release has branched a month ago, so you don't have to feel 
stressed over that.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157201/new/

https://reviews.llvm.org/D157201

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D156247: [Clang] Add a warning on uses of coroutine keywords

2023-07-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

In D156247#4541756 , @ilya-biryukov 
wrote:

> @aaron.ballman the internal -cc1 flag
>
> - internal `clang -cc1 -fno-coroutines`.

I'm sorry, but I find this wording misleading. `-cc1 -fno-coroutines` is not 
internal in the same sense as e.g. `-verify` is. Both are hidden from 
user-facing drivers, but unlike `-verify`, potential `-cc1 -fno-coroutines` is 
not just intended, but focused on users outside of monorepo. So I'd say it's 
going to be hidden but user-facing feature, rather than internal one. And the 
one that we should document and test if not for users, then for ourselves to 
make sure we maintain its semantics and don't break users. At this point I'd 
say if we go for it, we should go for proper driver option, rather than 
frontend one.

I also wonder how much complexity this language dialect would introduce while 
interacting with other language dialect flags. Is it really worth it?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156247/new/

https://reviews.llvm.org/D156247

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64087: [clang] Correct source locations for instantiations of out-of-line defaulted special member functions. (PR25683)

2023-09-10 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

@tahonermann Do you mind rebasing this on top of trunk if it's necessary?
Might be a good idea to resubmit this as PR.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64087/new/

https://reviews.llvm.org/D64087

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D152632: [Clang] Add warnings for CWG2521

2023-07-11 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill accepted this revision as: Endill.
Endill added a comment.

DR testing side looks good, but you should wait for more approvals.
Thank you for addressing all the issues there!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152632/new/

https://reviews.llvm.org/D152632

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D153156: [Clang] CWG1473: do not err on the lack of space after operator""

2023-07-11 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr14xx.cpp:491
+  float operator ""_E(const char *);
+  // expected-warning@+1 {{user-defined literal suffixes not starting with '_' 
are reserved; no literal will invoke this operator}}
+  float operator ""E(const char *); // don't err on the lack of spaces even 
when the literal suffix identifier is invalid

Can you move this down, so that offset is negative (after @)?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153156/new/

https://reviews.llvm.org/D153156

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151697: [clang] Add test for CWG1710 and related issues

2023-07-11 Thread Vlad Serebrennikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1bbaabb90dd7: [clang] Add test for CWG1710 and related 
issues (authored by Endill).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151697/new/

https://reviews.llvm.org/D151697

Files:
  clang/test/CXX/drs/dr17xx.cpp
  clang/test/CXX/drs/dr18xx.cpp
  clang/test/CXX/drs/dr3xx.cpp
  clang/www/cxx_dr_status.html

Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1923,7 +1923,7 @@
 https://cplusplus.github.io/CWG/issues/314.html";>314
 C++17
 template in base class specifier
-Unknown
+No
   
   
 https://cplusplus.github.io/CWG/issues/315.html";>315
@@ -2097,7 +2097,7 @@
 https://cplusplus.github.io/CWG/issues/343.html";>343
 C++17
 Make template optional in contexts that require a type
-Unknown
+No
   
   
 https://cplusplus.github.io/CWG/issues/344.html";>344
@@ -10067,7 +10067,7 @@
 https://cplusplus.github.io/CWG/issues/1710.html";>1710
 C++17
 Missing template keyword in class-or-decltype
-Unknown
+No
   
   
 https://cplusplus.github.io/CWG/issues/1711.html";>1711
@@ -10571,7 +10571,7 @@
 https://cplusplus.github.io/CWG/issues/1794.html";>1794
 C++17
 template keyword and alias templates
-Unknown
+Yes
   
   
 https://cplusplus.github.io/CWG/issues/1795.html";>1795
@@ -10679,7 +10679,7 @@
 https://cplusplus.github.io/CWG/issues/1812.html";>1812
 C++17
 Omission of template in a typename-specifier
-Unknown
+No
   
   
 https://cplusplus.github.io/CWG/issues/1813.html";>1813
Index: clang/test/CXX/drs/dr3xx.cpp
===
--- clang/test/CXX/drs/dr3xx.cpp
+++ clang/test/CXX/drs/dr3xx.cpp
@@ -208,14 +208,20 @@
 #endif
 }
 
-namespace dr314 { // FIXME 314: dup 1710
-  template struct A {
-template struct B {};
-  };
-  template struct C : public A::template B {
-C() : A::template B() {}
-  };
-}
+namespace dr314 { // dr314: no
+  // NB: dup 1710
+template  struct A {
+  template  struct B {};
+};
+template  struct C : public A::template B {
+  C() : A::template B() {}
+};
+template  struct C2 : public A::B {
+  // expected-error@-1 {{use 'template' keyword to treat 'B' as a dependent template name}}
+  C2() : A::B() {}
+  // expected-error@-1 {{use 'template' keyword to treat 'B' as a dependent template name}}
+};
+} // namespace dr314
 
 // dr315: na
 // dr316: sup 1004
@@ -591,7 +597,7 @@
 
 // dr342: na
 
-namespace dr343 { // FIXME 343: no
+namespace dr343 { // dr343: no
   // FIXME: dup 1710
   template struct A {
 template struct B {};
Index: clang/test/CXX/drs/dr18xx.cpp
===
--- clang/test/CXX/drs/dr18xx.cpp
+++ clang/test/CXX/drs/dr18xx.cpp
@@ -4,12 +4,23 @@
 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2c -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors
 
 #if __cplusplus < 201103L
 // expected-error@+1 {{variadic macro}}
 #define static_assert(...) __extension__ _Static_assert(__VA_ARGS__)
 #endif
 
+namespace dr1812 { // dr1812: no
+   // NB: dup 1710
+#if __cplusplus >= 201103L
+template  struct A {
+  using B = typename T::C;
+  // expected-error@-1 {{use 'template' keyword to treat 'C' as a dependent template name}}
+};
+#endif
+} // namespace dr1812
+
 namespace dr1813 { // dr1813: 7
   struct B { int i; };
   struct C : B {};
Index: clang/test/CXX/drs/dr17xx.cpp
===
--- clang/test/CXX/drs/dr17xx.cpp
+++ clang/test/CXX/drs/dr17xx.cpp
@@ -1,7 +1,22 @@
 // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2c %s -verify -fexceptions -fcxx

[PATCH] D138822: [clang] Add test for CWG36

2022-11-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a project: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138822

Files:
  clang/test/CXX/drs/dr0xx.cpp
  clang/www/cxx_dr_status.html
  clang/www/make_cxx_dr_status

Index: clang/www/make_cxx_dr_status
===
--- clang/www/make_cxx_dr_status
+++ clang/www/make_cxx_dr_status
@@ -158,7 +158,7 @@
 # This refers to the old ("C++0x") concepts feature, which was not part
 # of any C++ International Standard or Technical Specification.
 continue
-  if dr.issue in (1432,2565):
+  if dr.issue in (2565, 2628):
 row_style = ' class="open"'
 avail, avail_style = availability(dr.issue)
   elif dr.status in ('open', 'concurrency', 'drafting', 'review', 'extension'):
Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -252,9 +252,9 @@
   
   
 https://wg21.link/cwg36";>36
-DRWP
+CD6
 using-declarations in multiple-declaration contexts
-Unknown
+Yes
   
   
 https://wg21.link/cwg37";>37
@@ -696,7 +696,7 @@
   
   
 https://wg21.link/cwg110";>110
-DRWP
+CD6
 Can template functions and classes be declared in the same scope?
 Unknown
   
@@ -864,7 +864,7 @@
   
   
 https://wg21.link/cwg138";>138
-DRWP
+CD6
 Friend declaration name lookup
 Unknown
   
@@ -1056,7 +1056,7 @@
   
   
 https://wg21.link/cwg170";>170
-open
+review
 Pointer-to-member conversions
 Not resolved
   
@@ -1182,7 +1182,7 @@
   
   
 https://wg21.link/cwg191";>191
-DRWP
+CD6
 Name lookup does not handle complex nesting
 Unknown
   
@@ -1567,7 +1567,7 @@
   
   
 https://wg21.link/cwg255";>255
-DRWP
+CD6
 Placement deallocation functions and lookup ambiguity
 Unknown
   
@@ -1664,7 +1664,7 @@
   
   
 https://wg21.link/cwg271";>271
-DRWP
+CD6
 Explicit instantiation and template argument deduction
 Unknown
   
@@ -1712,7 +1712,7 @@
   
   
 https://wg21.link/cwg279";>279
-DRWP
+CD6
 Correspondence of "names for linkage purposes"
 Unknown
   
@@ -2066,7 +2066,7 @@
   
   
 https://wg21.link/cwg338";>338
-DRWP
+CD6
 Enumerator name with linkage used as class name in other translation unit
 Unknown
   
@@ -2198,7 +2198,7 @@
   
   
 https://wg21.link/cwg360";>360
-DRWP
+CD6
 Using-declaration that reduces access
 Unknown
   
@@ -2354,7 +2354,7 @@
   
   
 https://wg21.link/cwg386";>386
-DRWP
+CD6
 Friend declaration of name brought in by using-declaration
 Unknown
   
@@ -2432,7 +2432,7 @@
   
   
 https://wg21.link/cwg399";>399
-DRWP
+CD6
 Destructor lookup redux
 Unknown
   
@@ -2468,7 +2468,7 @@
   
   
 https://wg21.link/cwg405";>405
-DRWP
+CD6
 Unqualified function name lookup
 Unknown
   
@@ -2504,7 +2504,7 @@
   
   
 https://wg21.link/cwg411";>411
-WP
+CD6
 Use of universal-character-name in character versus string literals
 Unknown
   
@@ -2546,7 +2546,7 @@
   
   
 https://wg21.link/cwg418";>418
-DRWP
+CD6
 Imperfect wording on error on multiple default arguments on a called function
 Unknown
   
@@ -2766,11 +2766,11 @@
 When is a definition of a static data member required?
 Unknown
   
-  
+  
 https://wg21.link/cwg455";>455
-open
+NAD
 Partial ordering and non-deduced arguments
-Not resolved
+Unknown
   
   
 https://wg21.link/cwg456";>456
@@ -3254,7 +3254,7 @@
   
   
 https://wg21.link/cwg536";>536
-DRWP
+CD6
 Problems in the description of id-expressions
 Unknown
   
@@ -3364,7 +3364,7 @@
   
   
 https://wg21.link/cwg554";>554
-DRWP
+CD6
 Definition of “declarative region” and “scope”
 Unknown
   
@@ -3412,13 +3412,13 @@
   
   
 https://wg21.link/cwg562";>562
-DRWP
+CD6
 qualified-ids in non-expression contexts
 Unknown
   
   
 https://wg21.link/cwg563";>563
-DRWP
+CD6
 Linkage specification for objects
 Unknown
   
@@ -3506,11 +3506,11 @@
 void in an empty parameter list
 Yes
   
-  
+  
 https://wg21.link/cwg578";>578
-review
+CD6
 Phase 1 replacement of characters with universal-character-names
-Not resolved
+Unknown
   
   
 https://wg21.link/cwg579";>579
@@ -3640,7 +3640,7 @@
   
   
 https://wg21.link/cwg600";>600
-DRWP
+CD6
 Does access control apply to members or to names?
 Unknown
   
@@ -3682,7 +3682,7 @@
   
   
 https://wg21.link/cwg607";>607
-DRWP
+CD6
 Lookup of mem-initializer-ids
 Unknown
   
@@ -4760,11 +4760,11 @@

[PATCH] D138822: [clang] Add test for CWG36

2022-11-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Sure, I'll update core issue list in a separate diff.
I don't have commit rights, but I have a commit merged (just one). Does it make 
me eligible for that?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138835: [clang] Update DR status to Revision 110

2022-11-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Here it is: Vlad Serebrennikov 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138835/new/

https://reviews.llvm.org/D138835

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138835: [clang] Update DR status to Revision 110

2022-11-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Thank you for prompt review


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138835/new/

https://reviews.llvm.org/D138835

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 478300.
Endill added a comment.

Incorporate D138835 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

Files:
  clang/www/cxx_dr_status.html
  clang/www/make_cxx_dr_status

Index: clang/www/make_cxx_dr_status
===
--- clang/www/make_cxx_dr_status
+++ clang/www/make_cxx_dr_status
@@ -158,7 +158,7 @@
 # This refers to the old ("C++0x") concepts feature, which was not part
 # of any C++ International Standard or Technical Specification.
 continue
-  if dr.issue in (1432,2565):
+  if dr.issue in (2565, 2628):
 row_style = ' class="open"'
 avail, avail_style = availability(dr.issue)
   elif dr.status in ('open', 'concurrency', 'drafting', 'review', 'extension'):
Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -252,7 +252,7 @@
   
   
 https://wg21.link/cwg36";>36
-DRWP
+CD6
 using-declarations in multiple-declaration contexts
 Unknown
   
@@ -696,7 +696,7 @@
   
   
 https://wg21.link/cwg110";>110
-DRWP
+CD6
 Can template functions and classes be declared in the same scope?
 Unknown
   
@@ -864,7 +864,7 @@
   
   
 https://wg21.link/cwg138";>138
-DRWP
+CD6
 Friend declaration name lookup
 Unknown
   
@@ -1056,7 +1056,7 @@
   
   
 https://wg21.link/cwg170";>170
-open
+review
 Pointer-to-member conversions
 Not resolved
   
@@ -1182,7 +1182,7 @@
   
   
 https://wg21.link/cwg191";>191
-DRWP
+CD6
 Name lookup does not handle complex nesting
 Unknown
   
@@ -1567,7 +1567,7 @@
   
   
 https://wg21.link/cwg255";>255
-DRWP
+CD6
 Placement deallocation functions and lookup ambiguity
 Unknown
   
@@ -1664,7 +1664,7 @@
   
   
 https://wg21.link/cwg271";>271
-DRWP
+CD6
 Explicit instantiation and template argument deduction
 Unknown
   
@@ -1712,7 +1712,7 @@
   
   
 https://wg21.link/cwg279";>279
-DRWP
+CD6
 Correspondence of "names for linkage purposes"
 Unknown
   
@@ -2066,7 +2066,7 @@
   
   
 https://wg21.link/cwg338";>338
-DRWP
+CD6
 Enumerator name with linkage used as class name in other translation unit
 Unknown
   
@@ -2198,7 +2198,7 @@
   
   
 https://wg21.link/cwg360";>360
-DRWP
+CD6
 Using-declaration that reduces access
 Unknown
   
@@ -2354,7 +2354,7 @@
   
   
 https://wg21.link/cwg386";>386
-DRWP
+CD6
 Friend declaration of name brought in by using-declaration
 Unknown
   
@@ -2432,7 +2432,7 @@
   
   
 https://wg21.link/cwg399";>399
-DRWP
+CD6
 Destructor lookup redux
 Unknown
   
@@ -2468,7 +2468,7 @@
   
   
 https://wg21.link/cwg405";>405
-DRWP
+CD6
 Unqualified function name lookup
 Unknown
   
@@ -2504,7 +2504,7 @@
   
   
 https://wg21.link/cwg411";>411
-WP
+CD6
 Use of universal-character-name in character versus string literals
 Unknown
   
@@ -2546,7 +2546,7 @@
   
   
 https://wg21.link/cwg418";>418
-DRWP
+CD6
 Imperfect wording on error on multiple default arguments on a called function
 Unknown
   
@@ -2766,11 +2766,11 @@
 When is a definition of a static data member required?
 Unknown
   
-  
+  
 https://wg21.link/cwg455";>455
-open
+NAD
 Partial ordering and non-deduced arguments
-Not resolved
+Unknown
   
   
 https://wg21.link/cwg456";>456
@@ -3254,7 +3254,7 @@
   
   
 https://wg21.link/cwg536";>536
-DRWP
+CD6
 Problems in the description of id-expressions
 Unknown
   
@@ -3364,7 +3364,7 @@
   
   
 https://wg21.link/cwg554";>554
-DRWP
+CD6
 Definition of “declarative region” and “scope”
 Unknown
   
@@ -3412,13 +3412,13 @@
   
   
 https://wg21.link/cwg562";>562
-DRWP
+CD6
 qualified-ids in non-expression contexts
 Unknown
   
   
 https://wg21.link/cwg563";>563
-DRWP
+CD6
 Linkage specification for objects
 Unknown
   
@@ -3506,11 +3506,11 @@
 void in an empty parameter list
 Yes
   
-  
+  
 https://wg21.link/cwg578";>578
-review
+CD6
 Phase 1 replacement of characters with universal-character-names
-Not resolved
+Unknown
   
   
 https://wg21.link/cwg579";>579
@@ -3640,7 +3640,7 @@
   
   
 https://wg21.link/cwg600";>600
-DRWP
+CD6
 Does access control apply to members or to names?
 Unknown
   
@@ -3682,7 +3682,7 @@
   
   
 https://wg21.link/cwg607";>607
-DRWP
+CD6
 Lookup of mem-initializer-ids
 Unknown
   
@@ -4760,11 +4760,11 @@
 Use of class members during destruction
 Unknown
   
-  
+  
 https://wg21.link/cwg794";>794
-extension
+NAD
 Bas

[PATCH] D138822: [clang] Add test for CWG36

2022-11-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Sorry, I messed up diff update


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 478303.
Endill added a comment.

Incorporate D138835  (correctly this time 
around)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

Files:
  clang/test/CXX/drs/dr0xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -254,7 +254,7 @@
 https://wg21.link/cwg36";>36
 CD6
 using-declarations in multiple-declaration contexts
-Unknown
+Yes
   
   
 https://wg21.link/cwg37";>37
Index: clang/test/CXX/drs/dr0xx.cpp
===
--- clang/test/CXX/drs/dr0xx.cpp
+++ clang/test/CXX/drs/dr0xx.cpp
@@ -2,6 +2,8 @@
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -triple %itanium_abi_triple
 
 namespace dr1 { // dr1: no
   namespace X { extern "C" void dr1_f(int a = 1); }
@@ -448,6 +450,50 @@
 
 // dr34: na
 // dr35: dup 178
+
+namespace dr36 { // dr36: yes
+namespace example1 {
+  namespace A {
+int i;
+  }
+  
+  namespace A1 {
+using A::i;
+using A::i;
+  }
+  
+  void f()
+  {
+using A::i;
+using A::i;
+  }
+}
+
+namespace example2 {
+  struct A
+  {
+int i;
+static int j;
+  };
+
+  struct B : A { };
+  struct C : A { };
+
+  struct D : virtual B, virtual C
+  {
+using B::i; // expected-note {{previous using declaration}}
+using C::i; // expected-note {{previous using declaration}}
+using B::j; // expected-note {{previous using declaration}}
+using C::j; // expected-note {{previous using declaration}}
+
+using B::i; // expected-error {{redeclaration of using declaration}}
+using C::i; // expected-error {{redeclaration of using declaration}}
+using B::j; // expected-error {{redeclaration of using declaration}}
+using C::j; // expected-error {{redeclaration of using declaration}}
+  };
+}
+}
+
 // dr37: sup 475
 
 namespace dr38 { // dr38: yes
@@ -699,6 +745,8 @@
 }
 
 namespace dr59 { // dr59: yes
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-volatile"
   template struct convert_to { operator T() const; };
   struct A {}; // expected-note 5+{{candidate}}
   struct B : A {}; // expected-note 0+{{candidate}}
@@ -732,6 +780,7 @@
   int n3 = convert_to();
   int n4 = convert_to();
   int n5 = convert_to();
+#pragma clang diagnostic pop
 }
 
 namespace dr60 { // dr60: yes


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -254,7 +254,7 @@
 https://wg21.link/cwg36";>36
 CD6
 using-declarations in multiple-declaration contexts
-Unknown
+Yes
   
   
 https://wg21.link/cwg37";>37
Index: clang/test/CXX/drs/dr0xx.cpp
===
--- clang/test/CXX/drs/dr0xx.cpp
+++ clang/test/CXX/drs/dr0xx.cpp
@@ -2,6 +2,8 @@
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 
 namespace dr1 { // dr1: no
   namespace X { extern "C" void dr1_f(int a = 1); }
@@ -448,6 +450,50 @@
 
 // dr34: na
 // dr35: dup 178
+
+namespace dr36 { // dr36: yes
+namespace example1 {
+  namespace A {
+int i;
+  }
+  
+  namespace A1 {
+using A::i;
+using A::i;
+  }
+  
+  void f()
+  {
+using A::i;
+using A::i;
+  }
+}
+
+namespace example2 {
+  struct A
+  {
+int i;
+static int j;
+  };
+
+  struct B : A { };
+  struct C : A { };
+
+  struct D : virtual B, virtual C
+  {
+using B::i; // expected-note {{previous using declaration}}
+using C::i; // expected-note {{previous using declaration}}
+using B::j; // expected-note {{previous using declaration}}
+using C::j; // expected-note {{previous using declaration}}
+
+using B::i; // expected-error

[PATCH] D138895: [clang] Update CWG2635 status

2022-11-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added reviewers: clang-language-wg, erichkeane.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

A follow-up to D138852 . Apparently 
cxx_dr_status.html was changed manually there, since make_cxx_dr_status script 
doesn't generate the same HTML after that patch landed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138895

Files:
  clang/test/CXX/drs/dr26xx.cpp
  clang/www/make_cxx_dr_status


Index: clang/www/make_cxx_dr_status
===
--- clang/www/make_cxx_dr_status
+++ clang/www/make_cxx_dr_status
@@ -158,18 +158,18 @@
 # This refers to the old ("C++0x") concepts feature, which was not part
 # of any C++ International Standard or Technical Specification.
 continue
-  if dr.issue in (2565, 2628):
+  elif dr.status == 'extension':
 row_style = ' class="open"'
-avail, avail_style = availability(dr.issue)
-  elif dr.status in ('open', 'concurrency', 'drafting', 'review', 'extension'):
-# We may have to deal with these some day, but not yet.
+avail = 'Extension'
+avail_style = ''
+  elif dr.status in ('open', 'drafting', 'review'):
 row_style = ' class="open"'
-if dr.status == 'extension':
-  avail = 'Extension'
-else:
+avail, avail_style = availability(dr.issue)
+if avail == 'Unknown':
   avail = 'Not resolved'
-avail_style = ''
-assert dr.issue not in status_map, "have status for not-ready dr %s" % 
dr.issue
+  avail_style = ''
+if not avail.startswith('Sup') and not avail.startswith('Dup'):
+  count[avail] = count.get(avail, 0) + 1
   else:
 row_style = ''
 avail, avail_style = availability(dr.issue)
Index: clang/test/CXX/drs/dr26xx.cpp
===
--- clang/test/CXX/drs/dr26xx.cpp
+++ clang/test/CXX/drs/dr26xx.cpp
@@ -29,7 +29,7 @@
 
 }
 
-namespace dr2635 { // dr2635: yes
+namespace dr2635 { // dr2635: 16
 template
 concept UnaryC = true;
 template


Index: clang/www/make_cxx_dr_status
===
--- clang/www/make_cxx_dr_status
+++ clang/www/make_cxx_dr_status
@@ -158,18 +158,18 @@
 # This refers to the old ("C++0x") concepts feature, which was not part
 # of any C++ International Standard or Technical Specification.
 continue
-  if dr.issue in (2565, 2628):
+  elif dr.status == 'extension':
 row_style = ' class="open"'
-avail, avail_style = availability(dr.issue)
-  elif dr.status in ('open', 'concurrency', 'drafting', 'review', 'extension'):
-# We may have to deal with these some day, but not yet.
+avail = 'Extension'
+avail_style = ''
+  elif dr.status in ('open', 'drafting', 'review'):
 row_style = ' class="open"'
-if dr.status == 'extension':
-  avail = 'Extension'
-else:
+avail, avail_style = availability(dr.issue)
+if avail == 'Unknown':
   avail = 'Not resolved'
-avail_style = ''
-assert dr.issue not in status_map, "have status for not-ready dr %s" % dr.issue
+  avail_style = ''
+if not avail.startswith('Sup') and not avail.startswith('Dup'):
+  count[avail] = count.get(avail, 0) + 1
   else:
 row_style = ''
 avail, avail_style = availability(dr.issue)
Index: clang/test/CXX/drs/dr26xx.cpp
===
--- clang/test/CXX/drs/dr26xx.cpp
+++ clang/test/CXX/drs/dr26xx.cpp
@@ -29,7 +29,7 @@
 
 }
 
-namespace dr2635 { // dr2635: yes
+namespace dr2635 { // dr2635: 16
 template
 concept UnaryC = true;
 template
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138895: [clang] Update CWG2635 status

2022-11-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Sorry, some other WIP got in there. I'll remove it in a moment


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138895/new/

https://reviews.llvm.org/D138895

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138895: [clang] Update CWG2635 status

2022-11-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 478457.
Endill added a comment.

Remove WIP for another patch


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138895/new/

https://reviews.llvm.org/D138895

Files:
  clang/test/CXX/drs/dr26xx.cpp


Index: clang/test/CXX/drs/dr26xx.cpp
===
--- clang/test/CXX/drs/dr26xx.cpp
+++ clang/test/CXX/drs/dr26xx.cpp
@@ -29,7 +29,7 @@
 
 }
 
-namespace dr2635 { // dr2635: yes
+namespace dr2635 { // dr2635: 16
 template
 concept UnaryC = true;
 template


Index: clang/test/CXX/drs/dr26xx.cpp
===
--- clang/test/CXX/drs/dr26xx.cpp
+++ clang/test/CXX/drs/dr26xx.cpp
@@ -29,7 +29,7 @@
 
 }
 
-namespace dr2635 { // dr2635: yes
+namespace dr2635 { // dr2635: 16
 template
 concept UnaryC = true;
 template
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138901: [clang] Propely handle tests for open DRs in make_cxx_dr_status

2022-11-29 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added reviewers: erichkeane, ychen, clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

A follow-up to D136133 . It was mentioned in 
#58382 
 
that there is a need to test for DRs that have not been officially resolved 
yet. This patch aims to replace original "hackery" with proper handling for 
such cases. Highlights:

- Availability can be suffixed (further) with "open", "drafting", or "review", 
e.g. `// dr2565: 16 open`, `// dr: 16 c++17 drafting`
- Checks are implemented to ensure that this suffix corresponds to actual issue 
status
- Non-resolved DRs are counted (stdout of make_cxx_dr_status)
- No changes made to cxx_dr_status.html
- 'c++20' availability suffix added
- Remove 'concurrency' status since it's no longer on the list of statuses in 
CWG Active Issues


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138901

Files:
  clang/test/CXX/drs/dr25xx.cpp
  clang/test/CXX/drs/dr26xx.cpp
  clang/www/make_cxx_dr_status

Index: clang/www/make_cxx_dr_status
===
--- clang/www/make_cxx_dr_status
+++ clang/www/make_cxx_dr_status
@@ -95,6 +95,18 @@
 
 def availability(issue):
   status = status_map.get(issue, 'unknown')
+  
+  unresolved_status = ''
+  if status.endswith(' open'):
+status = status[:-5]
+unresolved_status = 'open'
+  elif status.endswith(' drafting'):
+status = status[:-9]
+unresolved_status = 'drafting'
+  elif status.endswith(' review'):
+status = status[:-7]
+unresolved_status = 'review'
+
   avail_suffix = ''
   if status.endswith(' c++11'):
 status = status[:-6]
@@ -105,6 +117,9 @@
   elif status.endswith(' c++17'):
 status = status[:-6]
 avail_suffix = ' (C++17 onwards)'
+  elif status.endswith(' c++20'):
+status = status[:-6]
+avail_suffix = ' (C++20 onwards)'
   if status == 'unknown':
 avail = 'Unknown'
 avail_style = ' class="none"'
@@ -140,17 +155,17 @@
 else:
   avail = 'Superseded by %s' % (dup, dup)
   try:
-_, avail_style = availability(int(dup))
+_, avail_style, _ = availability(int(dup))
   except:
 print("issue %s marked as sup %s" % (issue, dup), file=sys.stderr)
 avail_style = ' class="none"'
   elif status.startswith('dup '):
 dup = int(status.split(' ', 1)[1])
 avail = 'Duplicate of %s' % (dup, dup)
-_, avail_style = availability(dup)
+_, avail_style, _ = availability(dup)
   else:
 assert False, 'unknown status %s for issue %s' % (status, dr.issue)
-  return (avail + avail_suffix, avail_style)
+  return (avail + avail_suffix, avail_style, unresolved_status)
 
 count = {}
 for dr in drs:
@@ -158,21 +173,28 @@
 # This refers to the old ("C++0x") concepts feature, which was not part
 # of any C++ International Standard or Technical Specification.
 continue
-  if dr.issue in (2565, 2628):
+  elif dr.status == 'extension':
 row_style = ' class="open"'
-avail, avail_style = availability(dr.issue)
-  elif dr.status in ('open', 'concurrency', 'drafting', 'review', 'extension'):
-# We may have to deal with these some day, but not yet.
+avail = 'Extension'
+avail_style = ''
+  elif dr.status in ('open', 'drafting', 'review'):
 row_style = ' class="open"'
-if dr.status == 'extension':
-  avail = 'Extension'
-else:
+avail, avail_style, unresolved_status = availability(dr.issue)
+if avail == 'Unknown':
   avail = 'Not resolved'
-avail_style = ''
-assert dr.issue not in status_map, "have status for not-ready dr %s" % dr.issue
+  avail_style = ''
+else:
+  assert unresolved_status == dr.status, \
+ "Issue %s is marked '%s', which differs from CWG index status '%s'" \
+ % (dr.issue, unresolved_status, dr.status)
+if not avail.startswith('Sup') and not avail.startswith('Dup'):
+  count[avail] = count.get(avail, 0) + 1
   else:
 row_style = ''
-avail, avail_style = availability(dr.issue)
+avail, avail_style, unresolved_status = availability(dr.issue)
+assert not unresolved_status, \
+   "Issue %s is marked '%s', even though it is resolved in CWG index" \
+   % (dr.issue, unresolved_status)
 if not avail.startswith('Sup') and not avail.startswith('Dup'):
   count[avail] = count.get(avail, 0) + 1
 
Index: clang/test/CXX/drs/dr26xx.cpp
===
--- clang/test/CXX/drs/dr26xx.cpp
+++ clang/test/CXX/drs/dr26xx.cpp
@@ -14,7 +14,7 @@
 }
 }
 
-namespace dr2628 { // dr2628: yes
+namespace dr2628 { // dr2628: yes open
 
 template 
 struct foo {
Index: clang/test/CXX/drs/dr25xx.cpp

[PATCH] D138901: [clang] Propely handle tests for open DRs in make_cxx_dr_status

2022-11-29 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Can I kindly ask you to commit this?
I guess I can ask for commit access after this patch, and not bother you any 
further.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138901/new/

https://reviews.llvm.org/D138901

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-29 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

@aaron.ballman Following example of other DR test, I was reluctant to add 
relevant comments, e.g. wording. But I can provide it going forward or even 
update this patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-29 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Among the worst parts of this paper are references to mailing list and EDG 
wiki, which I don't have access to. But I still managed to dig everything up, 
and ready to explain if requested. No tests were copied blindly from issues.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-29 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Thank you!

> FWIW, if you need help getting references from the mailing list or the wiki, 
> feel free to mention what you're after and one of us on the committee can see 
> about tracking down the details.

Do you mean creating an incomplete diff and asking here in the comments?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-29 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Discord feels perfect to me for this kind of questions. What's left is to get 
past a broken bot for agreeing with code of conduct.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-29 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr0xx.cpp:489
+
+using B::i; // expected-error {{redeclaration of using declaration}}
+using C::i; // expected-error {{redeclaration of using declaration}}

erichkeane wrote:
> As a nit, I prefer the 'notes' to live next to the error, and use a bookmark 
> line-marker here.  My issue is basically how we have no way of knowing 
> (particularly in template code...) what this diagnoses.
> 
> I would also think a dependent example of this diagnostic would be useful.
>I would also think a dependent example of this diagnostic would be useful.
Do you mean something of this sort: `using D::i`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-30 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 478875.
Endill added a comment.

Add examples with dependent types, and rearrange using declarations to group 
errors and notes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

Files:
  clang/test/CXX/drs/dr0xx.cpp
  clang/www/cxx_dr_status.html

Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -254,7 +254,7 @@
 https://wg21.link/cwg36";>36
 CD6
 using-declarations in multiple-declaration contexts
-Unknown
+Yes
   
   
 https://wg21.link/cwg37";>37
Index: clang/test/CXX/drs/dr0xx.cpp
===
--- clang/test/CXX/drs/dr0xx.cpp
+++ clang/test/CXX/drs/dr0xx.cpp
@@ -2,6 +2,8 @@
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 
 namespace dr1 { // dr1: no
   namespace X { extern "C" void dr1_f(int a = 1); }
@@ -448,6 +450,94 @@
 
 // dr34: na
 // dr35: dup 178
+
+namespace dr36 { // dr36: yes
+namespace example1 {
+  namespace A {
+int i;
+  }
+  
+  namespace A1 {
+using A::i;
+using A::i;
+  }
+  
+  void f()
+  {
+using A::i;
+using A::i;
+  }
+}
+
+namespace example2 {
+  struct A
+  {
+int i;
+static int j;
+  };
+
+  struct B : A { };
+  struct C : A { };
+
+  struct D : virtual B, virtual C
+  {
+using B::i; // expected-note {{previous using declaration}}
+using B::i; // expected-error {{redeclaration of using declaration}}
+
+using C::i; // expected-note {{previous using declaration}}
+using C::i; // expected-error {{redeclaration of using declaration}}
+
+using B::j; // expected-note {{previous using declaration}}
+using B::j; // expected-error {{redeclaration of using declaration}}
+
+using C::j; // expected-note {{previous using declaration}}
+using C::j; // expected-error {{redeclaration of using declaration}}
+  };
+}
+
+namespace example3 {
+  template
+  struct A
+  {
+T i;
+static T j;
+  };
+
+  template
+  struct B : A { };
+  template
+  struct C : A { };
+
+  template
+  struct D : virtual B, virtual C
+  {
+using B::i; // expected-note {{previous using declaration}}
+using B::i; // expected-error {{redeclaration of using declaration}}
+
+using C::i; // expected-note {{previous using declaration}}
+using C::i; // expected-error {{redeclaration of using declaration}}
+
+using B::j; // expected-note {{previous using declaration}}
+using B::j; // expected-error {{redeclaration of using declaration}}
+
+using C::j; // expected-note {{previous using declaration}}
+using C::j; // expected-error {{redeclaration of using declaration}}
+  };
+}
+namespace example4 {
+  template
+  struct E {
+T k;
+  };
+
+  template
+  struct G : E {
+using E::k; // expected-note {{previous using declaration}}
+using E::k; // expected-error {{redeclaration of using declaration}}
+  };
+}
+}
+
 // dr37: sup 475
 
 namespace dr38 { // dr38: yes
@@ -699,6 +789,8 @@
 }
 
 namespace dr59 { // dr59: yes
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-volatile"
   template struct convert_to { operator T() const; };
   struct A {}; // expected-note 5+{{candidate}}
   struct B : A {}; // expected-note 0+{{candidate}}
@@ -732,6 +824,7 @@
   int n3 = convert_to();
   int n4 = convert_to();
   int n5 = convert_to();
+#pragma clang diagnostic pop
 }
 
 namespace dr60 { // dr60: yes
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-30 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 478878.
Endill added a comment.

Get rid of unwanted changes supposedly cause by `arc diff`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

Files:
  clang/test/CXX/drs/dr0xx.cpp
  clang/www/cxx_dr_status.html

Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -254,7 +254,7 @@
 https://wg21.link/cwg36";>36
 CD6
 using-declarations in multiple-declaration contexts
-Unknown
+Yes
   
   
 https://wg21.link/cwg37";>37
Index: clang/test/CXX/drs/dr0xx.cpp
===
--- clang/test/CXX/drs/dr0xx.cpp
+++ clang/test/CXX/drs/dr0xx.cpp
@@ -2,6 +2,8 @@
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 
 namespace dr1 { // dr1: no
   namespace X { extern "C" void dr1_f(int a = 1); }
@@ -448,6 +450,94 @@
 
 // dr34: na
 // dr35: dup 178
+
+namespace dr36 { // dr36: yes
+namespace example1 {
+  namespace A {
+int i;
+  }
+  
+  namespace A1 {
+using A::i;
+using A::i;
+  }
+  
+  void f()
+  {
+using A::i;
+using A::i;
+  }
+}
+
+namespace example2 {
+  struct A
+  {
+int i;
+static int j;
+  };
+
+  struct B : A { };
+  struct C : A { };
+
+  struct D : virtual B, virtual C
+  {
+using B::i; // expected-note {{previous using declaration}}
+using B::i; // expected-error {{redeclaration of using declaration}}
+
+using C::i; // expected-note {{previous using declaration}}
+using C::i; // expected-error {{redeclaration of using declaration}}
+
+using B::j; // expected-note {{previous using declaration}}
+using B::j; // expected-error {{redeclaration of using declaration}}
+
+using C::j; // expected-note {{previous using declaration}}
+using C::j; // expected-error {{redeclaration of using declaration}}
+  };
+}
+
+namespace example3 {
+  template
+  struct A
+  {
+T i;
+static T j;
+  };
+
+  template
+  struct B : A { };
+  template
+  struct C : A { };
+
+  template
+  struct D : virtual B, virtual C
+  {
+using B::i; // expected-note {{previous using declaration}}
+using B::i; // expected-error {{redeclaration of using declaration}}
+
+using C::i; // expected-note {{previous using declaration}}
+using C::i; // expected-error {{redeclaration of using declaration}}
+
+using B::j; // expected-note {{previous using declaration}}
+using B::j; // expected-error {{redeclaration of using declaration}}
+
+using C::j; // expected-note {{previous using declaration}}
+using C::j; // expected-error {{redeclaration of using declaration}}
+  };
+}
+namespace example4 {
+  template
+  struct E {
+T k;
+  };
+
+  template
+  struct G : E {
+using E::k; // expected-note {{previous using declaration}}
+using E::k; // expected-error {{redeclaration of using declaration}}
+  };
+}
+}
+
 // dr37: sup 475
 
 namespace dr38 { // dr38: yes
@@ -699,6 +789,8 @@
 }
 
 namespace dr59 { // dr59: yes
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-volatile"
   template struct convert_to { operator T() const; };
   struct A {}; // expected-note 5+{{candidate}}
   struct B : A {}; // expected-note 0+{{candidate}}
@@ -732,6 +824,7 @@
   int n3 = convert_to();
   int n4 = convert_to();
   int n5 = convert_to();
+#pragma clang diagnostic pop
 }
 
 namespace dr60 { // dr60: yes
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-30 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr0xx.cpp:489
+
+using B::i; // expected-error {{redeclaration of using declaration}}
+using C::i; // expected-error {{redeclaration of using declaration}}

erichkeane wrote:
> Endill wrote:
> > erichkeane wrote:
> > > As a nit, I prefer the 'notes' to live next to the error, and use a 
> > > bookmark line-marker here.  My issue is basically how we have no way of 
> > > knowing (particularly in template code...) what this diagnoses.
> > > 
> > > I would also think a dependent example of this diagnostic would be useful.
> > >I would also think a dependent example of this diagnostic would be useful.
> > Do you mean something of this sort: `using D::i`?
> That is a good example too, but more a case where the using expression is 
> dependent, so something like: `using Struct::i` sorta thing
> I prefer the 'notes' to live next to the error
done

> I would also think a dependent example of this diagnostic would be useful.
I'm not sure how you wanted it to interact with virtual bases, so I wrote 
examples both with virtual bases and without

> use a bookmark line-marker here
While I'm sympathetic to your concern, and agree that bookmarks allow to order 
expected errors and notes in the order they would appear for user, searching 
for `@#` gives only 5 DR tests. If that's the direction we want DR tests to 
take, we should be explicit about this, because almost all existing tests have 
to be adjusted.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-11-30 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr0xx.cpp:489
+
+using B::i; // expected-error {{redeclaration of using declaration}}
+using C::i; // expected-error {{redeclaration of using declaration}}

aaron.ballman wrote:
> Endill wrote:
> > erichkeane wrote:
> > > Endill wrote:
> > > > erichkeane wrote:
> > > > > As a nit, I prefer the 'notes' to live next to the error, and use a 
> > > > > bookmark line-marker here.  My issue is basically how we have no way 
> > > > > of knowing (particularly in template code...) what this diagnoses.
> > > > > 
> > > > > I would also think a dependent example of this diagnostic would be 
> > > > > useful.
> > > > >I would also think a dependent example of this diagnostic would be 
> > > > >useful.
> > > > Do you mean something of this sort: `using D::i`?
> > > That is a good example too, but more a case where the using expression is 
> > > dependent, so something like: `using Struct::i` sorta thing
> > > I prefer the 'notes' to live next to the error
> > done
> > 
> > > I would also think a dependent example of this diagnostic would be useful.
> > I'm not sure how you wanted it to interact with virtual bases, so I wrote 
> > examples both with virtual bases and without
> > 
> > > use a bookmark line-marker here
> > While I'm sympathetic to your concern, and agree that bookmarks allow to 
> > order expected errors and notes in the order they would appear for user, 
> > searching for `@#` gives only 5 DR tests. If that's the direction we want 
> > DR tests to take, we should be explicit about this, because almost all 
> > existing tests have to be adjusted.
> > While I'm sympathetic to your concern, and agree that bookmarks allow to 
> > order expected errors and notes in the order they would appear for user, 
> > searching for @# gives only 5 DR tests. If that's the direction we want DR 
> > tests to take, we should be explicit about this, because almost all 
> > existing tests have to be adjusted.
> 
> FWIW, we don't have to adjust all the tests -- sometimes bookmarks make 
> things more clear, other times they don't help all that much, and it's an 
> equivalent test either way. My recommendation is to use bookmarks when you 
> think they make sense to use or when a reviewer asks for one. Updating other 
> tests can be done with NFC changes if someone sees a particular need.
> FWIW, we don't have to adjust all the tests -- sometimes bookmarks make 
> things more clear, other times they don't help all that much, and it's an 
> equivalent test either way. My recommendation is to use bookmarks when you 
> think they make sense to use or when a reviewer asks for one. Updating other 
> tests can be done with NFC changes if someone sees a particular need.

The concern about expected-note comments scattered across a test seems 
applicable to any test with more than one expected-warning or expected-error. 
If maintainers agree that it should be addressed with bookmarks, I'll update 
this patch, and make NFC commits to fix existing tests.

What I'd like to avoid is introducing even more inconsistencies into DR tests. 
Until very recently (before tests for 2565 and 2628), bookmarks have been used 
only under `#if __cplusplus`, where you don't have any other straightforward 
option (e.g. dr100).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139090: [clang] Add test for CWG360

2022-12-01 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : "CWG360 is resolved by applying access 
control to using-declarations."
class.access.general#4 
: "When a 
using-declarator is named, access control is applied to it, not to the 
declarations that replace it."


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139090

Files:
  clang/test/CXX/drs/dr3xx.cpp


Index: clang/test/CXX/drs/dr3xx.cpp
===
--- clang/test/CXX/drs/dr3xx.cpp
+++ clang/test/CXX/drs/dr3xx.cpp
@@ -890,6 +890,33 @@
   };
 }
 
+namespace dr360 { // dr360: yes
+struct A {
+  int foo();
+  int bar();
+
+protected:
+  int baz();
+};
+
+struct B : A {
+private:
+  using A::foo; // #dr360-foo-using-decl
+protected:
+  using A::bar; // #dr360-bar-using-decl
+public:
+  using A::baz; // #dr360-baz-using-decl
+};
+
+int main() {
+  int foo = B().foo(); // expected-error {{is a private member}}
+  // expected-note@#dr360-foo-using-decl {{declared private here}}
+  int bar = B().bar(); // expected-error {{is a protected member}}
+  // expected-note@#dr360-bar-using-decl {{declared protected here}}
+  int baz = B().baz();
+}
+} // namespace dr360
+
 // dr362: na
 // dr363: na
 


Index: clang/test/CXX/drs/dr3xx.cpp
===
--- clang/test/CXX/drs/dr3xx.cpp
+++ clang/test/CXX/drs/dr3xx.cpp
@@ -890,6 +890,33 @@
   };
 }
 
+namespace dr360 { // dr360: yes
+struct A {
+  int foo();
+  int bar();
+
+protected:
+  int baz();
+};
+
+struct B : A {
+private:
+  using A::foo; // #dr360-foo-using-decl
+protected:
+  using A::bar; // #dr360-bar-using-decl
+public:
+  using A::baz; // #dr360-baz-using-decl
+};
+
+int main() {
+  int foo = B().foo(); // expected-error {{is a private member}}
+  // expected-note@#dr360-foo-using-decl {{declared private here}}
+  int bar = B().bar(); // expected-error {{is a protected member}}
+  // expected-note@#dr360-bar-using-decl {{declared protected here}}
+  int baz = B().baz();
+}
+} // namespace dr360
+
 // dr362: na
 // dr363: na
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139090: [clang] Add test for CWG360

2022-12-01 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 479225.
Endill added a comment.

run make_cxx_dr_status


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139090/new/

https://reviews.llvm.org/D139090

Files:
  clang/test/CXX/drs/dr3xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -2200,7 +2200,7 @@
 https://wg21.link/cwg360";>360
 CD6
 Using-declaration that reduces access
-Unknown
+Yes
   
   
 https://wg21.link/cwg361";>361
Index: clang/test/CXX/drs/dr3xx.cpp
===
--- clang/test/CXX/drs/dr3xx.cpp
+++ clang/test/CXX/drs/dr3xx.cpp
@@ -890,6 +890,33 @@
   };
 }
 
+namespace dr360 { // dr360: yes
+struct A {
+  int foo();
+  int bar();
+
+protected:
+  int baz();
+};
+
+struct B : A {
+private:
+  using A::foo; // #dr360-foo-using-decl
+protected:
+  using A::bar; // #dr360-bar-using-decl
+public:
+  using A::baz; // #dr360-baz-using-decl
+};
+
+int main() {
+  int foo = B().foo(); // expected-error {{is a private member}}
+  // expected-note@#dr360-foo-using-decl {{declared private here}}
+  int bar = B().bar(); // expected-error {{is a protected member}}
+  // expected-note@#dr360-bar-using-decl {{declared protected here}}
+  int baz = B().baz();
+}
+} // namespace dr360
+
 // dr362: na
 // dr363: na
 


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -2200,7 +2200,7 @@
 https://wg21.link/cwg360";>360
 CD6
 Using-declaration that reduces access
-Unknown
+Yes
   
   
 https://wg21.link/cwg361";>361
Index: clang/test/CXX/drs/dr3xx.cpp
===
--- clang/test/CXX/drs/dr3xx.cpp
+++ clang/test/CXX/drs/dr3xx.cpp
@@ -890,6 +890,33 @@
   };
 }
 
+namespace dr360 { // dr360: yes
+struct A {
+  int foo();
+  int bar();
+
+protected:
+  int baz();
+};
+
+struct B : A {
+private:
+  using A::foo; // #dr360-foo-using-decl
+protected:
+  using A::bar; // #dr360-bar-using-decl
+public:
+  using A::baz; // #dr360-baz-using-decl
+};
+
+int main() {
+  int foo = B().foo(); // expected-error {{is a private member}}
+  // expected-note@#dr360-foo-using-decl {{declared private here}}
+  int bar = B().bar(); // expected-error {{is a protected member}}
+  // expected-note@#dr360-bar-using-decl {{declared protected here}}
+  int baz = B().baz();
+}
+} // namespace dr360
+
 // dr362: na
 // dr363: na
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139095: [clang] Mark CWG405 as a duplicate of CWG218

2022-12-01 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139095

Files:
  clang/test/CXX/drs/dr4xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -2470,7 +2470,7 @@
 https://wg21.link/cwg405";>405
 CD6
 Unqualified function name lookup
-Unknown
+Duplicate of 218
   
   
 https://wg21.link/cwg406";>406
Index: clang/test/CXX/drs/dr4xx.cpp
===
--- clang/test/CXX/drs/dr4xx.cpp
+++ clang/test/CXX/drs/dr4xx.cpp
@@ -79,6 +79,8 @@
 // dr404: na
 // (NB: also sup 594)
 
+// dr405: dup 218
+
 namespace dr406 { // dr406: yes
   typedef struct {
 static int n; // expected-error {{static data member 'n' not allowed in 
anonymous struct}}


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -2470,7 +2470,7 @@
 https://wg21.link/cwg405";>405
 CD6
 Unqualified function name lookup
-Unknown
+Duplicate of 218
   
   
 https://wg21.link/cwg406";>406
Index: clang/test/CXX/drs/dr4xx.cpp
===
--- clang/test/CXX/drs/dr4xx.cpp
+++ clang/test/CXX/drs/dr4xx.cpp
@@ -79,6 +79,8 @@
 // dr404: na
 // (NB: also sup 594)
 
+// dr405: dup 218
+
 namespace dr406 { // dr406: yes
   typedef struct {
 static int n; // expected-error {{static data member 'n' not allowed in anonymous struct}}
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139095: [clang] Mark CWG405 as a duplicate of CWG218

2022-12-01 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Is it fine that we're marking CWG405 as a duplicate even though it's not 
mentioned as such in official publication?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139095/new/

https://reviews.llvm.org/D139095

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139090: [clang] Add test for CWG360

2022-12-01 Thread Vlad Serebrennikov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3f950ad58919: [clang] Add test for CWG360 (authored by 
Endill).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139090/new/

https://reviews.llvm.org/D139090

Files:
  clang/test/CXX/drs/dr3xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -2200,7 +2200,7 @@
 https://wg21.link/cwg360";>360
 CD6
 Using-declaration that reduces access
-Unknown
+Yes
   
   
 https://wg21.link/cwg361";>361
Index: clang/test/CXX/drs/dr3xx.cpp
===
--- clang/test/CXX/drs/dr3xx.cpp
+++ clang/test/CXX/drs/dr3xx.cpp
@@ -890,6 +890,33 @@
   };
 }
 
+namespace dr360 { // dr360: yes
+struct A {
+  int foo();
+  int bar();
+
+protected:
+  int baz();
+};
+
+struct B : A {
+private:
+  using A::foo; // #dr360-foo-using-decl
+protected:
+  using A::bar; // #dr360-bar-using-decl
+public:
+  using A::baz; // #dr360-baz-using-decl
+};
+
+int main() {
+  int foo = B().foo(); // expected-error {{is a private member}}
+  // expected-note@#dr360-foo-using-decl {{declared private here}}
+  int bar = B().bar(); // expected-error {{is a protected member}}
+  // expected-note@#dr360-bar-using-decl {{declared protected here}}
+  int baz = B().baz();
+}
+} // namespace dr360
+
 // dr362: na
 // dr363: na
 


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -2200,7 +2200,7 @@
 https://wg21.link/cwg360";>360
 CD6
 Using-declaration that reduces access
-Unknown
+Yes
   
   
 https://wg21.link/cwg361";>361
Index: clang/test/CXX/drs/dr3xx.cpp
===
--- clang/test/CXX/drs/dr3xx.cpp
+++ clang/test/CXX/drs/dr3xx.cpp
@@ -890,6 +890,33 @@
   };
 }
 
+namespace dr360 { // dr360: yes
+struct A {
+  int foo();
+  int bar();
+
+protected:
+  int baz();
+};
+
+struct B : A {
+private:
+  using A::foo; // #dr360-foo-using-decl
+protected:
+  using A::bar; // #dr360-bar-using-decl
+public:
+  using A::baz; // #dr360-baz-using-decl
+};
+
+int main() {
+  int foo = B().foo(); // expected-error {{is a private member}}
+  // expected-note@#dr360-foo-using-decl {{declared private here}}
+  int bar = B().bar(); // expected-error {{is a protected member}}
+  // expected-note@#dr360-bar-using-decl {{declared protected here}}
+  int baz = B().baz();
+}
+} // namespace dr360
+
 // dr362: na
 // dr363: na
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139090: [clang] Add test for CWG360

2022-12-01 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr3xx.cpp:908
+public:
+  using A::baz; // #dr360-baz-using-decl
+};

erichkeane wrote:
> This bookmark isn't necessary, so no reason to have it.  But thank you for 
> using these!
Nice catch, thank you!
Seems like I should've waited a bit more before committing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139090/new/

https://reviews.llvm.org/D139090

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139095: [clang] Mark CWG405 as a duplicate of CWG218

2022-12-01 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

> I don't think we should mark it as a dup -- we want the status in our tests 
> to match the status on the official document, otherwise things get confusing.

We can do it the following way then: `// dr405: yes \n // NB: also dup 218`.
Do I understand correctly that superseded status should be used if and only if 
it's used in official document as well?

> The two issues are very closely related, but they change different words in 
> the standard and should be tested independently as best we can

Make no mistake here: proposed wording for 405 has never made it into the 
standard. I double-checked this with revision 100 of CWG issues, when this 
issue still had open status.
P1787  states that //CWG405 is resolved by 
stating that argument-dependent lookup (sometimes) occurs after an ordinary 
unqualified lookup (making statements like “finding a variable prevents 
argument-dependent lookup” formally correct).//
The only relevant wording in P1787  I can find 
is for [basic.lookup.argdep] p1 and p3 (too long; not citing them here). Which, 
curiously enough, clearly originates from resolution of 218, which is already 
tested. It also has the same intent as proposed resolution for 405.

So I'd like to raise a couple of questions:

1. What test for 405 is going to be if not a copy-and-paste of a part of 218 
test?
2. Is it possible to change status of 405 in the official document? Or get a 
technical rationale for it not being a duplicate of 218.

As a side note, I don't feel too comfortable testing name lookup via side 
effects like diagnostics. `#pragma clang __debug dump` is good, but not 
powerful enough to test ADL. Are those the only options we currently have?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139095/new/

https://reviews.llvm.org/D139095

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138822: [clang] Add test for CWG36

2022-12-01 Thread Vlad Serebrennikov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf5993fc7757e: [clang] Add test for CWG36 (authored by 
Endill).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138822/new/

https://reviews.llvm.org/D138822

Files:
  clang/test/CXX/drs/dr0xx.cpp
  clang/www/cxx_dr_status.html

Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -254,7 +254,7 @@
 https://wg21.link/cwg36";>36
 CD6
 using-declarations in multiple-declaration contexts
-Unknown
+Yes
   
   
 https://wg21.link/cwg37";>37
Index: clang/test/CXX/drs/dr0xx.cpp
===
--- clang/test/CXX/drs/dr0xx.cpp
+++ clang/test/CXX/drs/dr0xx.cpp
@@ -2,6 +2,8 @@
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 
 namespace dr1 { // dr1: no
   namespace X { extern "C" void dr1_f(int a = 1); }
@@ -448,6 +450,94 @@
 
 // dr34: na
 // dr35: dup 178
+
+namespace dr36 { // dr36: yes
+namespace example1 {
+  namespace A {
+int i;
+  }
+  
+  namespace A1 {
+using A::i;
+using A::i;
+  }
+  
+  void f()
+  {
+using A::i;
+using A::i;
+  }
+}
+
+namespace example2 {
+  struct A
+  {
+int i;
+static int j;
+  };
+
+  struct B : A { };
+  struct C : A { };
+
+  struct D : virtual B, virtual C
+  {
+using B::i; // expected-note {{previous using declaration}}
+using B::i; // expected-error {{redeclaration of using declaration}}
+
+using C::i; // expected-note {{previous using declaration}}
+using C::i; // expected-error {{redeclaration of using declaration}}
+
+using B::j; // expected-note {{previous using declaration}}
+using B::j; // expected-error {{redeclaration of using declaration}}
+
+using C::j; // expected-note {{previous using declaration}}
+using C::j; // expected-error {{redeclaration of using declaration}}
+  };
+}
+
+namespace example3 {
+  template
+  struct A
+  {
+T i;
+static T j;
+  };
+
+  template
+  struct B : A { };
+  template
+  struct C : A { };
+
+  template
+  struct D : virtual B, virtual C
+  {
+using B::i; // expected-note {{previous using declaration}}
+using B::i; // expected-error {{redeclaration of using declaration}}
+
+using C::i; // expected-note {{previous using declaration}}
+using C::i; // expected-error {{redeclaration of using declaration}}
+
+using B::j; // expected-note {{previous using declaration}}
+using B::j; // expected-error {{redeclaration of using declaration}}
+
+using C::j; // expected-note {{previous using declaration}}
+using C::j; // expected-error {{redeclaration of using declaration}}
+  };
+}
+namespace example4 {
+  template
+  struct E {
+T k;
+  };
+
+  template
+  struct G : E {
+using E::k; // expected-note {{previous using declaration}}
+using E::k; // expected-error {{redeclaration of using declaration}}
+  };
+}
+}
+
 // dr37: sup 475
 
 namespace dr38 { // dr38: yes
@@ -699,6 +789,8 @@
 }
 
 namespace dr59 { // dr59: yes
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-volatile"
   template struct convert_to { operator T() const; };
   struct A {}; // expected-note 5+{{candidate}}
   struct B : A {}; // expected-note 0+{{candidate}}
@@ -732,6 +824,7 @@
   int n3 = convert_to();
   int n4 = convert_to();
   int n5 = convert_to();
+#pragma clang diagnostic pop
 }
 
 namespace dr60 { // dr60: yes
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139172: [clang] Mark CWG554 as N/A

2022-12-01 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : //CWG554 is resolved by using the word 
“scope” instead of “declarative region”, consistent with its very common use in 
phrases like “namespace scope”.//


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139172

Files:
  clang/test/CXX/drs/dr5xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3366,7 +3366,7 @@
 https://wg21.link/cwg554";>554
 CD6
 Definition of “declarative region” and 
“scope”
-Unknown
+N/A
   
   
 https://wg21.link/cwg555";>555
Index: clang/test/CXX/drs/dr5xx.cpp
===
--- clang/test/CXX/drs/dr5xx.cpp
+++ clang/test/CXX/drs/dr5xx.cpp
@@ -602,6 +602,7 @@
   };
 }
 
+// dr554: na
 // dr556: na
 
 namespace dr557 { // dr557: yes


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3366,7 +3366,7 @@
 https://wg21.link/cwg554";>554
 CD6
 Definition of “declarative region” and “scope”
-Unknown
+N/A
   
   
 https://wg21.link/cwg555";>555
Index: clang/test/CXX/drs/dr5xx.cpp
===
--- clang/test/CXX/drs/dr5xx.cpp
+++ clang/test/CXX/drs/dr5xx.cpp
@@ -602,6 +602,7 @@
   };
 }
 
+// dr554: na
 // dr556: na
 
 namespace dr557 { // dr557: yes
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139173: [clang] Add test for CWG600

2022-12-02 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : //CWG600 is resolved by explaining that 
accessibility affects naming a member in the sense of the ODR.//
Wording: see changes to [class.access] p1 and p4.
Additional references: basic.def.odr/8 
: //A function is odr-used 
if it is named by a potentially-evaluated expression or conversion.//


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139173

Files:
  clang/test/CXX/drs/dr6xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3642,7 +3642,7 @@
 https://wg21.link/cwg600";>600
 CD6
 Does access control apply to members or to names?
-Unknown
+Yes
   
   
 https://wg21.link/cwg601";>601
Index: clang/test/CXX/drs/dr6xx.cpp
===
--- clang/test/CXX/drs/dr6xx.cpp
+++ clang/test/CXX/drs/dr6xx.cpp
@@ -3,6 +3,21 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -fno-spell-checking
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -fno-spell-checking
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -fno-spell-checking
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -fno-spell-checking
+
+namespace dr600 { // dr600: yes
+struct S {
+  void f(int);
+
+private:
+  void f(double); // expected-note {{declared private here}}
+};
+
+void g(S *sp) {
+  sp->f(2);
+  sp->f(2.2); // expected-error {{is a private member}}
+}
+} // namespace dr600
 
 namespace std {
   struct type_info {};


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3642,7 +3642,7 @@
 https://wg21.link/cwg600";>600
 CD6
 Does access control apply to members or to names?
-Unknown
+Yes
   
   
 https://wg21.link/cwg601";>601
Index: clang/test/CXX/drs/dr6xx.cpp
===
--- clang/test/CXX/drs/dr6xx.cpp
+++ clang/test/CXX/drs/dr6xx.cpp
@@ -3,6 +3,21 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
+
+namespace dr600 { // dr600: yes
+struct S {
+  void f(int);
+
+private:
+  void f(double); // expected-note {{declared private here}}
+};
+
+void g(S *sp) {
+  sp->f(2);
+  sp->f(2.2); // expected-error {{is a private member}}
+}
+} // namespace dr600
 
 namespace std {
   struct type_info {};
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139172: [clang] Mark CWG554 as N/A

2022-12-02 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

> There are many editorial issues that ended up as defect reports, you could 
> probably batch many of them in subsequent PR

Thank you for suggestion. I'm being on a safer side at the moment, because 
CWG405 raised more questions than I anticipated.
I'll also wait until tomorrow morning (≈18 hours from now) to let everybody 
interested comment on this, to avoid situations like the one with CWG360 
yesterday.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139172/new/

https://reviews.llvm.org/D139172

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139095: [clang] Mark CWG405 as a duplicate of CWG218

2022-12-02 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

> I think this is perfectly fine to have a duplicated test case, I agree with 
> Aaron, we should not invent duplicated status ourselves.
> Adding a comment in the test like "Note: this test is identical to the one 
> for CWG405" would be a good idea

Does it mean that duplication with cross-references is the best way to handle 
this even hypothetically? As opposed to, say, new notation for 
make_cxx_dr_status like `// dr405: dup 405 unofficial`.

> Nah, that wouldn't be worth the hassle, even if you got people to agree on 
> the duplicated nature

Sad but definitely not unexpected.

> You could do a codegen tests and check that the correct function gets called 
> using its mangled name. There are examples in the drs tests already, grep for 
> "// CHECK: call"

Thanks for mentioning this! Could definitely be used as a last resort. I'll try 
it for some of the subsequent CWG test.
Observing front-end behavior via back-end still doesn't feel good, though. I 
believe debug facilities should be improved to contain as much DR checks as 
possible at source and AST level.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139095/new/

https://reviews.llvm.org/D139095

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139095: [clang] Mark CWG405 as a duplicate of CWG218

2022-12-02 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

>> We can do it the following way then: // dr405: yes \n // NB: also dup 218.
>
> That would be fine by me!

Which way should we handle this? I'd prefer to do it without test duplication, 
but making it clear for readers is a serious concern indeed. (Read on, I 
elaborate on this below.)

>> What test for 405 is going to be if not a copy-and-paste of a part of 218 
>> test?
>
> In terms of test *coverage*, no benefit. In terms of *implementation status*, 
> it makes it clear we considered the DR explicitly instead of leaving future 
> folks to wonder.

Should we really try to meet an expectation that Clang developers haven't 
considered something as obvious as explicitly handling a DR not marked as 
duplicated or superseded officially? It doesn't seem a reasonable expectation 
to me, and at least my personal attitude have always been the opposite.
To be fully honest here, I don't even remember myself how I came across CWG218, 
because I did this test back in spring. So marking it as a duplicate (one way 
or another) on the contrary seems very considerate handling.

> CodeGen tests would be the approach I'd take; that's not actually testing the 
> backend behavior, that's still testing the frontend IR generation (which is 
> before the backend gets to start mutating/optimizing it).

You're very much right. Thank you for reminding me of that!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139095/new/

https://reviews.llvm.org/D139095

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139173: [clang] Add test for CWG600

2022-12-02 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr6xx.cpp:18
+  sp->f(2);
+  sp->f(2.2); // expected-error {{is a private member}}
+}

shafik wrote:
> Maybe add a comment above this saying something like:
> 
> ```
> // access control is applied after overload resolution
> // [class.access.general]p4 "For an overload set, access control is applied 
> only to the function selected by overload resolution."
> ```
I tend to like the idea, but I wonder about general rule for adding such 
explanations. Currently DR tests contain very little of those. 

If we're going to add explanations, we should also decide whether we're going 
to cite the standard, or paraphrase (and/or) explain intent. My concern is that 
both references to standard and citations could grow old relatively quickly, 
and we don't have any tools to help, at least yet.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139173/new/

https://reviews.llvm.org/D139173

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139172: [clang] Mark CWG554 as N/A

2022-12-02 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

> @aaron.ballman do you think it is worth it to provide a link to p1787 as 
> well? I know you can just goto the issue and see that but it feels helpful. I 
> actually missed this at first b/c I usually goto end of the issue to look for 
> the resolution and was confused.

I agree with Aaron about inconsistency, and would like to add that a simple 
reference to `P1787` is akin to pointing to a haystack when one is searching 
for the needle, especially the wording needle.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139172/new/

https://reviews.llvm.org/D139172

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139173: [clang] Add test for CWG600

2022-12-02 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a subscriber: aaron.ballman.
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr6xx.cpp:18
+  sp->f(2);
+  sp->f(2.2); // expected-error {{is a private member}}
+}

Endill wrote:
> shafik wrote:
> > Maybe add a comment above this saying something like:
> > 
> > ```
> > // access control is applied after overload resolution
> > // [class.access.general]p4 "For an overload set, access control is applied 
> > only to the function selected by overload resolution."
> > ```
> I tend to like the idea, but I wonder about general rule for adding such 
> explanations. Currently DR tests contain very little of those. 
> 
> If we're going to add explanations, we should also decide whether we're going 
> to cite the standard, or paraphrase (and/or) explain intent. My concern is 
> that both references to standard and citations could grow old relatively 
> quickly, and we don't have any tools to help, at least yet.
@aaron.ballman What do you think?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139173/new/

https://reviews.llvm.org/D139173

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139173: [clang] Add test for CWG600

2022-12-02 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr6xx.cpp:18
+  sp->f(2);
+  sp->f(2.2); // expected-error {{is a private member}}
+}

aaron.ballman wrote:
> Endill wrote:
> > Endill wrote:
> > > shafik wrote:
> > > > Maybe add a comment above this saying something like:
> > > > 
> > > > ```
> > > > // access control is applied after overload resolution
> > > > // [class.access.general]p4 "For an overload set, access control is 
> > > > applied only to the function selected by overload resolution."
> > > > ```
> > > I tend to like the idea, but I wonder about general rule for adding such 
> > > explanations. Currently DR tests contain very little of those. 
> > > 
> > > If we're going to add explanations, we should also decide whether we're 
> > > going to cite the standard, or paraphrase (and/or) explain intent. My 
> > > concern is that both references to standard and citations could grow old 
> > > relatively quickly, and we don't have any tools to help, at least yet.
> > @aaron.ballman What do you think?
> We don't typically add a significant amount of comments to test files unless 
> what is being tested needs some explanation. So, IMO, if the DR test case is 
> "tricky" in some way and we're trying to demonstrate that we're testing a 
> specific sentence or two from the standard, then I think a comment with 
> standards wording is reasonable (please don't just cite `[foo.bar]p12` though 
> -- add the standards wording!). However, if the test is pretty 
> straightforward, or the DR explains in more detail what's going on, then I 
> don't think we need to add the comment (the references get stale rather 
> quickly, even with stable names as in C++).
> 
> All that said, if you're on the fence about whether to add a comment or not, 
> go ahead and add it (IMO).
I think that this one is the case when DR explains it better, because that's 
what it is about. Adding a comment seems more appropriate for something that's 
not given enough attention or accent in the whole context of a DR test, as 
opposed to test code itself.

@shafik Is it fine by you if I don't add any comment?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139173/new/

https://reviews.llvm.org/D139173

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139173: [clang] Add test for CWG600

2022-12-03 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 479818.
Endill added a comment.

Add a comment per @shafik request


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139173/new/

https://reviews.llvm.org/D139173

Files:
  clang/test/CXX/drs/dr6xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3642,7 +3642,7 @@
 https://wg21.link/cwg600";>600
 CD6
 Does access control apply to members or to names?
-Unknown
+Yes
   
   
 https://wg21.link/cwg601";>601
Index: clang/test/CXX/drs/dr6xx.cpp
===
--- clang/test/CXX/drs/dr6xx.cpp
+++ clang/test/CXX/drs/dr6xx.cpp
@@ -3,6 +3,22 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -fno-spell-checking
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -fno-spell-checking
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -fno-spell-checking
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors -fno-spell-checking
+
+namespace dr600 { // dr600: yes
+struct S {
+  void f(int);
+
+private:
+  void f(double); // expected-note {{declared private here}}
+};
+
+void g(S *sp) {
+  sp->f(2);
+  // access control is applied after overload resolution
+  sp->f(2.2); // expected-error {{is a private member}}
+}
+} // namespace dr600
 
 namespace std {
   struct type_info {};


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3642,7 +3642,7 @@
 https://wg21.link/cwg600";>600
 CD6
 Does access control apply to members or to names?
-Unknown
+Yes
   
   
 https://wg21.link/cwg601";>601
Index: clang/test/CXX/drs/dr6xx.cpp
===
--- clang/test/CXX/drs/dr6xx.cpp
+++ clang/test/CXX/drs/dr6xx.cpp
@@ -3,6 +3,22 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking
+
+namespace dr600 { // dr600: yes
+struct S {
+  void f(int);
+
+private:
+  void f(double); // expected-note {{declared private here}}
+};
+
+void g(S *sp) {
+  sp->f(2);
+  // access control is applied after overload resolution
+  sp->f(2.2); // expected-error {{is a private member}}
+}
+} // namespace dr600
 
 namespace std {
   struct type_info {};
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139172: [clang] Mark CWG554 as N/A

2022-12-03 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

@shafik Would it be fine by you to proceed without changes?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139172/new/

https://reviews.llvm.org/D139172

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139095: [clang] Add test for CWG405

2022-12-03 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 479858.
Endill retitled this revision from "[clang] Mark CWG405 as a duplicate of 
CWG218" to "[clang] Add test for CWG405".
Endill edited the summary of this revision.
Endill added a comment.

Reuse a part of CWG218 test, adding cross-references.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139095/new/

https://reviews.llvm.org/D139095

Files:
  clang/test/CXX/drs/dr2xx.cpp
  clang/test/CXX/drs/dr4xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -2470,7 +2470,7 @@
 https://wg21.link/cwg405";>405
 CD6
 Unqualified function name lookup
-Unknown
+Yes
   
   
 https://wg21.link/cwg406";>406
Index: clang/test/CXX/drs/dr4xx.cpp
===
--- clang/test/CXX/drs/dr4xx.cpp
+++ clang/test/CXX/drs/dr4xx.cpp
@@ -3,6 +3,7 @@
 // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++14 
%s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++17 
%s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++20 
%s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++2b 
%s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 // FIXME: __SIZE_TYPE__ expands to 'long long' on some targets.
 __extension__ typedef __SIZE_TYPE__ size_t;
@@ -79,6 +80,40 @@
 // dr404: na
 // (NB: also sup 594)
 
+namespace dr405 { // dr405: yes
+  // NB: also dup 218
+  namespace A {
+struct S {};
+void f(S);
+  }
+  namespace B {
+struct S {};
+void f(S);
+  }
+
+  struct C {
+int f;
+void test1(A::S as) { f(as); } // expected-error {{called object type 
'int'}}
+void test2(A::S as) { void f(); f(as); } // expected-error {{too many 
arguments}} expected-note {{}}
+void test3(A::S as) { using A::f; f(as); } // ok
+void test4(A::S as) { using B::f; f(as); } // ok
+void test5(A::S as) { int f; f(as); } // expected-error {{called object 
type 'int'}}
+void test6(A::S as) { struct f {}; (void) f(as); } // expected-error {{no 
matching conversion}} expected-note +{{}}
+  };
+
+  namespace D {
+struct S {};
+struct X { void operator()(S); } f;
+  }
+  void testD(D::S ds) { f(ds); } // expected-error {{undeclared identifier}}
+
+  namespace E {
+struct S {};
+struct f { f(S); };
+  }
+  void testE(E::S es) { f(es); } // expected-error {{undeclared identifier}}
+}
+
 namespace dr406 { // dr406: yes
   typedef struct {
 static int n; // expected-error {{static data member 'n' not allowed in 
anonymous struct}}
Index: clang/test/CXX/drs/dr2xx.cpp
===
--- clang/test/CXX/drs/dr2xx.cpp
+++ clang/test/CXX/drs/dr2xx.cpp
@@ -141,6 +141,7 @@
 }
 
 namespace dr218 { // dr218: yes
+  // NB: also dup 405
   namespace A {
 struct S {};
 void f(S);


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -2470,7 +2470,7 @@
 https://wg21.link/cwg405";>405
 CD6
 Unqualified function name lookup
-Unknown
+Yes
   
   
 https://wg21.link/cwg406";>406
Index: clang/test/CXX/drs/dr4xx.cpp
===
--- clang/test/CXX/drs/dr4xx.cpp
+++ clang/test/CXX/drs/dr4xx.cpp
@@ -3,6 +3,7 @@
 // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 // FIXME: __SIZE_TYPE__ expands to 'long long' on some targets.
 __extension__ typedef __SIZE_TYPE__ size_t;
@@ -79,6 +80,40 @@
 // dr404: na
 // (NB: also sup 594)
 
+namespace dr405 { // dr405: yes
+  // NB: also dup 218
+  namespace A {
+struct S {};
+void f(S);
+  }
+  namespace B {
+struct S {};
+void f(S);
+  }
+
+  struct C {
+int f;
+void test1(A::S as) { f(as); } // expected-error {{called object type 'int'}}
+void test2(A::S as) { void f(); f(as); } // expected-error {{too many arguments}} expected-note {{}}
+void test3(A::S as) { using A::f; f(as); } // ok
+void test4(A::S as) { using B::f; f(

[PATCH] D139095: [clang] Add test for CWG405

2022-12-03 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr4xx.cpp:99
+void test3(A::S as) { using A::f; f(as); } // ok
+void test4(A::S as) { using B::f; f(as); } // ok
+void test5(A::S as) { int f; f(as); } // expected-error {{called object 
type 'int'}}

I'm surprised that local function declaration prevents ADL, but 
//using-declaration// doesn't. It has been working this way all along, so I 
guess I better take a note of this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139095/new/

https://reviews.llvm.org/D139095

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D144115: [clang] Extend pragma dump to support expressions

2023-03-21 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

ping


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144115/new/

https://reviews.llvm.org/D144115

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D144115: [clang] Extend pragma dump to support expressions

2023-03-21 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Thank you for review!




Comment at: clang/lib/Parse/ParsePragma.cpp:15-17
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Lex/LexDiagnostic.h"
 #include "clang/Lex/Preprocessor.h"

aaron.ballman wrote:
> 
I'm using `warn_pragma_debug_unexpected_argument` and 
`warn_pragma_debug_missing_argument` from there as well, and not just added 
diagnostics. What should I do about that? Copying them over to 
`DiagnosticParseKinds.td` doesn't work.



Comment at: clang/lib/Parse/ParsePragma.cpp:731-736
+} else if (E.get()->isTypeDependent()) {
+  PP.Diag(StartLoc, diag::warn_pragma_debug_type_dependent_argument)
+<< SourceRange(StartLoc, Tok.getLocation());
+} else if (E.get()->isValueDependent()) {
+  PP.Diag(StartLoc, diag::warn_pragma_debug_value_dependent_argument)
+<< SourceRange(StartLoc, Tok.getLocation());

aaron.ballman wrote:
> 
I see quite a lot of items inside `ExprDependence`. Are you sure we don't miss 
any corner cases by using `isValueDependent()` to select between value- and 
type-dependent diagnostic text? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144115/new/

https://reviews.llvm.org/D144115

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D144115: [clang] Extend pragma dump to support expressions

2023-03-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/lib/Parse/ParsePragma.cpp:731-736
+} else if (E.get()->isTypeDependent()) {
+  PP.Diag(StartLoc, diag::warn_pragma_debug_type_dependent_argument)
+<< SourceRange(StartLoc, Tok.getLocation());
+} else if (E.get()->isValueDependent()) {
+  PP.Diag(StartLoc, diag::warn_pragma_debug_value_dependent_argument)
+<< SourceRange(StartLoc, Tok.getLocation());

aaron.ballman wrote:
> Endill wrote:
> > aaron.ballman wrote:
> > > 
> > I see quite a lot of items inside `ExprDependence`. Are you sure we don't 
> > miss any corner cases by using `isValueDependent()` to select between 
> > value- and type-dependent diagnostic text? 
> I was trying to think of a case where we'd run into problems, but I can't 
> come up with one, so I believe we're fine here.
Apparently, we should do it the other way round, because `An id-expression is 
value-dependent if: — it is type-dependent` ([[ 
http://eel.is/c++draft/temp.dep#constexpr-2.2 | temp.dep.constexpr/2.2]]). I 
observe that in one of the tests I added, `T{}` is TypeValueInstantiation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144115/new/

https://reviews.llvm.org/D144115

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D144115: [clang] Extend pragma dump to support expressions

2023-03-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 507843.
Endill added a comment.

- Handle expressions as unevaluated operands
- Numerous fixes to documentation wording
- Add release notes entry
- Prevent generic "unknown argument" diagnostic from being issued when other 
more specific diagnostics have been emitted
- Add more tests


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144115/new/

https://reviews.llvm.org/D144115

Files:
  clang/docs/LanguageExtensions.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/DiagnosticCommonKinds.td
  clang/include/clang/Basic/DiagnosticLexKinds.td
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/Lex/Pragma.cpp
  clang/lib/Parse/ParsePragma.cpp
  clang/lib/Sema/SemaLookup.cpp
  clang/test/AST/ast-dump-lookups.cpp

Index: clang/test/AST/ast-dump-lookups.cpp
===
--- clang/test/AST/ast-dump-lookups.cpp
+++ clang/test/AST/ast-dump-lookups.cpp
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix DECLS %s
 // RUN: %clang_cc1 -std=c++11 -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix LOOKUPS %s
 // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix DECLS-LOOKUPS %s
-// RUN: %clang_cc1 -std=c++11 -DPRAGMA -fsyntax-only %s 2>&1 | FileCheck -check-prefix PRAGMA %s
+// RUN: %clang_cc1 -std=c++11 -DPRAGMA -fsyntax-only -verify %s 2>&1 | FileCheck -check-prefix PRAGMA %s
 
 namespace Test {
   typedef int T;
@@ -51,3 +51,50 @@
 //
 // DECLS-LOOKUPS: Dumping Test:
 // DECLS-LOOKUPS-NEXT: Lookup map is in primary DeclContext
+
+#ifdef PRAGMA
+namespace Test {
+  struct S {
+const S& operator+(const S&) { return *this; }
+  };
+  void foo(S) {}
+}
+
+#pragma clang __debug dump foo(Test::S{})
+// PRAGMA: CallExpr {{.*}} adl
+// PRAGMA-NEXT: |-ImplicitCastExpr {{.*}}
+// PRAGMA-NEXT: | `-DeclRefExpr {{.*}} 'void (S)' lvalue Function {{.*}} 'foo' 'void (S)'
+
+#pragma clang __debug dump Test::S{} + Test::S{}
+// PRAGMA: CXXOperatorCallExpr {{.*}}
+// PRAGMA-NEXT: |-ImplicitCastExpr {{.*}}
+// PRAGMA-NEXT: | `-DeclRefExpr {{.*}} 'const S &(const S &)' lvalue CXXMethod {{.*}} 'operator+' 'const S &(const S &)'
+
+#pragma clang __debug dump &Test::S::operator+
+// PRAGMA: UnaryOperator {{.*}}
+// PRAGMA-NEXT: `-DeclRefExpr {{.*}} 'const S &(const S &)' CXXMethod {{.*}} 'operator+' 'const S &(const S &)'
+
+template
+void bar() {
+#pragma clang __debug dump T{} // expected-warning {{type-dependent expression}}
+#pragma clang __debug dump +I  // expected-warning {{value-dependent expression}}
+}
+
+template 
+struct S {
+  static constexpr const T *str = "string";
+};
+
+template <>
+struct S {
+  static constexpr const wchar_t *str = L"wide string";
+};
+
+void func() {
+  #pragma clang __debug dump S::str;
+  // PRAGMA: DeclRefExpr {{.*}} 'const wchar_t *const' lvalue Var {{.*}} 'str' 'const wchar_t *const'
+}
+
+#pragma clang __debug dump this is nonsense // expected-error {{invalid use of 'this'}}
+
+#endif
Index: clang/lib/Sema/SemaLookup.cpp
===
--- clang/lib/Sema/SemaLookup.cpp
+++ clang/lib/Sema/SemaLookup.cpp
@@ -5841,3 +5841,7 @@
   LookupName(R, S);
   R.dump();
 }
+
+void Sema::ActOnPragmaDump(Expr *E) {
+  E->dump();
+}
Index: clang/lib/Parse/ParsePragma.cpp
===
--- clang/lib/Parse/ParsePragma.cpp
+++ clang/lib/Parse/ParsePragma.cpp
@@ -706,10 +706,36 @@
 
 void Parser::HandlePragmaDump() {
   assert(Tok.is(tok::annot_pragma_dump));
-  IdentifierInfo *II =
-  reinterpret_cast(Tok.getAnnotationValue());
-  Actions.ActOnPragmaDump(getCurScope(), Tok.getLocation(), II);
   ConsumeAnnotationToken();
+  if (Tok.is(tok::eod)) {
+PP.Diag(Tok, diag::warn_pragma_debug_missing_argument) << "dump";
+  } else if (NextToken().is(tok::eod)) {
+if (Tok.isNot(tok::identifier)) {
+  PP.Diag(Tok, diag::warn_pragma_debug_unexpected_argument);
+  ConsumeAnyToken();
+  ExpectAndConsume(tok::eod);
+  return;
+}
+IdentifierInfo *II = Tok.getIdentifierInfo();
+Actions.ActOnPragmaDump(getCurScope(), Tok.getLocation(), II);
+ConsumeToken();
+  } else {
+SourceLocation StartLoc = Tok.getLocation();
+EnterExpressionEvaluationContext Ctx(
+  Actions, Sema::ExpressionEvaluationContext::Unevaluated);
+ExprResult E = ParseExpression();
+if (!E.isUsable() || E.get()->containsErrors()) {
+  // Diagnostics were emitted during parsing. No action needed.
+} else if (E.get()->getDependence() != ExprDependence::None) {
+  PP.Diag(StartLoc, diag::warn_pragma_debug_dependent_argument)
+<< E.get()->isTypeDependent()
+<< SourceRange(StartLoc, Tok.getLocation());
+} else {
+  Actions.ActOnPragmaDump(E.get());

[PATCH] D144115: [clang] Extend pragma dump to support expressions

2023-03-24 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 508086.
Endill added a comment.

Rebase


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144115/new/

https://reviews.llvm.org/D144115

Files:
  clang/docs/LanguageExtensions.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/DiagnosticCommonKinds.td
  clang/include/clang/Basic/DiagnosticLexKinds.td
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/Lex/Pragma.cpp
  clang/lib/Parse/ParsePragma.cpp
  clang/lib/Sema/SemaLookup.cpp
  clang/test/AST/ast-dump-lookups.cpp

Index: clang/test/AST/ast-dump-lookups.cpp
===
--- clang/test/AST/ast-dump-lookups.cpp
+++ clang/test/AST/ast-dump-lookups.cpp
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix DECLS %s
 // RUN: %clang_cc1 -std=c++11 -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix LOOKUPS %s
 // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix DECLS-LOOKUPS %s
-// RUN: %clang_cc1 -std=c++11 -DPRAGMA -fsyntax-only %s 2>&1 | FileCheck -check-prefix PRAGMA %s
+// RUN: %clang_cc1 -std=c++11 -DPRAGMA -fsyntax-only -verify %s 2>&1 | FileCheck -check-prefix PRAGMA %s
 
 namespace Test {
   typedef int T;
@@ -51,3 +51,50 @@
 //
 // DECLS-LOOKUPS: Dumping Test:
 // DECLS-LOOKUPS-NEXT: Lookup map is in primary DeclContext
+
+#ifdef PRAGMA
+namespace Test {
+  struct S {
+const S& operator+(const S&) { return *this; }
+  };
+  void foo(S) {}
+}
+
+#pragma clang __debug dump foo(Test::S{})
+// PRAGMA: CallExpr {{.*}} adl
+// PRAGMA-NEXT: |-ImplicitCastExpr {{.*}}
+// PRAGMA-NEXT: | `-DeclRefExpr {{.*}} 'void (S)' lvalue Function {{.*}} 'foo' 'void (S)'
+
+#pragma clang __debug dump Test::S{} + Test::S{}
+// PRAGMA: CXXOperatorCallExpr {{.*}}
+// PRAGMA-NEXT: |-ImplicitCastExpr {{.*}}
+// PRAGMA-NEXT: | `-DeclRefExpr {{.*}} 'const S &(const S &)' lvalue CXXMethod {{.*}} 'operator+' 'const S &(const S &)'
+
+#pragma clang __debug dump &Test::S::operator+
+// PRAGMA: UnaryOperator {{.*}}
+// PRAGMA-NEXT: `-DeclRefExpr {{.*}} 'const S &(const S &)' CXXMethod {{.*}} 'operator+' 'const S &(const S &)'
+
+template
+void bar() {
+#pragma clang __debug dump T{} // expected-warning {{type-dependent expression}}
+#pragma clang __debug dump +I  // expected-warning {{value-dependent expression}}
+}
+
+template 
+struct S {
+  static constexpr const T *str = "string";
+};
+
+template <>
+struct S {
+  static constexpr const wchar_t *str = L"wide string";
+};
+
+void func() {
+  #pragma clang __debug dump S::str;
+  // PRAGMA: DeclRefExpr {{.*}} 'const wchar_t *const' lvalue Var {{.*}} 'str' 'const wchar_t *const'
+}
+
+#pragma clang __debug dump this is nonsense // expected-error {{invalid use of 'this'}}
+
+#endif
Index: clang/lib/Sema/SemaLookup.cpp
===
--- clang/lib/Sema/SemaLookup.cpp
+++ clang/lib/Sema/SemaLookup.cpp
@@ -5841,3 +5841,7 @@
   LookupName(R, S);
   R.dump();
 }
+
+void Sema::ActOnPragmaDump(Expr *E) {
+  E->dump();
+}
Index: clang/lib/Parse/ParsePragma.cpp
===
--- clang/lib/Parse/ParsePragma.cpp
+++ clang/lib/Parse/ParsePragma.cpp
@@ -706,10 +706,36 @@
 
 void Parser::HandlePragmaDump() {
   assert(Tok.is(tok::annot_pragma_dump));
-  IdentifierInfo *II =
-  reinterpret_cast(Tok.getAnnotationValue());
-  Actions.ActOnPragmaDump(getCurScope(), Tok.getLocation(), II);
   ConsumeAnnotationToken();
+  if (Tok.is(tok::eod)) {
+PP.Diag(Tok, diag::warn_pragma_debug_missing_argument) << "dump";
+  } else if (NextToken().is(tok::eod)) {
+if (Tok.isNot(tok::identifier)) {
+  PP.Diag(Tok, diag::warn_pragma_debug_unexpected_argument);
+  ConsumeAnyToken();
+  ExpectAndConsume(tok::eod);
+  return;
+}
+IdentifierInfo *II = Tok.getIdentifierInfo();
+Actions.ActOnPragmaDump(getCurScope(), Tok.getLocation(), II);
+ConsumeToken();
+  } else {
+SourceLocation StartLoc = Tok.getLocation();
+EnterExpressionEvaluationContext Ctx(
+  Actions, Sema::ExpressionEvaluationContext::Unevaluated);
+ExprResult E = ParseExpression();
+if (!E.isUsable() || E.get()->containsErrors()) {
+  // Diagnostics were emitted during parsing. No action needed.
+} else if (E.get()->getDependence() != ExprDependence::None) {
+  PP.Diag(StartLoc, diag::warn_pragma_debug_dependent_argument)
+<< E.get()->isTypeDependent()
+<< SourceRange(StartLoc, Tok.getLocation());
+} else {
+  Actions.ActOnPragmaDump(E.get());
+}
+SkipUntil(tok::eod, StopBeforeMatch);
+  }
+  ExpectAndConsume(tok::eod);
 }
 
 void Parser::HandlePragmaWeak() {
Index: clang/lib/Lex/Pragma.cpp
===
--- clang/lib/Lex/P

[PATCH] D144115: [clang] Extend pragma dump to support expressions

2023-03-24 Thread Vlad Serebrennikov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG467ed2798772: [clang] Extend pragma dump to support 
expressions (authored by Endill).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144115/new/

https://reviews.llvm.org/D144115

Files:
  clang/docs/LanguageExtensions.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/DiagnosticCommonKinds.td
  clang/include/clang/Basic/DiagnosticLexKinds.td
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/Lex/Pragma.cpp
  clang/lib/Parse/ParsePragma.cpp
  clang/lib/Sema/SemaLookup.cpp
  clang/test/AST/ast-dump-lookups.cpp

Index: clang/test/AST/ast-dump-lookups.cpp
===
--- clang/test/AST/ast-dump-lookups.cpp
+++ clang/test/AST/ast-dump-lookups.cpp
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix DECLS %s
 // RUN: %clang_cc1 -std=c++11 -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix LOOKUPS %s
 // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix DECLS-LOOKUPS %s
-// RUN: %clang_cc1 -std=c++11 -DPRAGMA -fsyntax-only %s 2>&1 | FileCheck -check-prefix PRAGMA %s
+// RUN: %clang_cc1 -std=c++11 -DPRAGMA -fsyntax-only -verify %s 2>&1 | FileCheck -check-prefix PRAGMA %s
 
 namespace Test {
   typedef int T;
@@ -51,3 +51,50 @@
 //
 // DECLS-LOOKUPS: Dumping Test:
 // DECLS-LOOKUPS-NEXT: Lookup map is in primary DeclContext
+
+#ifdef PRAGMA
+namespace Test {
+  struct S {
+const S& operator+(const S&) { return *this; }
+  };
+  void foo(S) {}
+}
+
+#pragma clang __debug dump foo(Test::S{})
+// PRAGMA: CallExpr {{.*}} adl
+// PRAGMA-NEXT: |-ImplicitCastExpr {{.*}}
+// PRAGMA-NEXT: | `-DeclRefExpr {{.*}} 'void (S)' lvalue Function {{.*}} 'foo' 'void (S)'
+
+#pragma clang __debug dump Test::S{} + Test::S{}
+// PRAGMA: CXXOperatorCallExpr {{.*}}
+// PRAGMA-NEXT: |-ImplicitCastExpr {{.*}}
+// PRAGMA-NEXT: | `-DeclRefExpr {{.*}} 'const S &(const S &)' lvalue CXXMethod {{.*}} 'operator+' 'const S &(const S &)'
+
+#pragma clang __debug dump &Test::S::operator+
+// PRAGMA: UnaryOperator {{.*}}
+// PRAGMA-NEXT: `-DeclRefExpr {{.*}} 'const S &(const S &)' CXXMethod {{.*}} 'operator+' 'const S &(const S &)'
+
+template
+void bar() {
+#pragma clang __debug dump T{} // expected-warning {{type-dependent expression}}
+#pragma clang __debug dump +I  // expected-warning {{value-dependent expression}}
+}
+
+template 
+struct S {
+  static constexpr const T *str = "string";
+};
+
+template <>
+struct S {
+  static constexpr const wchar_t *str = L"wide string";
+};
+
+void func() {
+  #pragma clang __debug dump S::str;
+  // PRAGMA: DeclRefExpr {{.*}} 'const wchar_t *const' lvalue Var {{.*}} 'str' 'const wchar_t *const'
+}
+
+#pragma clang __debug dump this is nonsense // expected-error {{invalid use of 'this'}}
+
+#endif
Index: clang/lib/Sema/SemaLookup.cpp
===
--- clang/lib/Sema/SemaLookup.cpp
+++ clang/lib/Sema/SemaLookup.cpp
@@ -5841,3 +5841,7 @@
   LookupName(R, S);
   R.dump();
 }
+
+void Sema::ActOnPragmaDump(Expr *E) {
+  E->dump();
+}
Index: clang/lib/Parse/ParsePragma.cpp
===
--- clang/lib/Parse/ParsePragma.cpp
+++ clang/lib/Parse/ParsePragma.cpp
@@ -706,10 +706,36 @@
 
 void Parser::HandlePragmaDump() {
   assert(Tok.is(tok::annot_pragma_dump));
-  IdentifierInfo *II =
-  reinterpret_cast(Tok.getAnnotationValue());
-  Actions.ActOnPragmaDump(getCurScope(), Tok.getLocation(), II);
   ConsumeAnnotationToken();
+  if (Tok.is(tok::eod)) {
+PP.Diag(Tok, diag::warn_pragma_debug_missing_argument) << "dump";
+  } else if (NextToken().is(tok::eod)) {
+if (Tok.isNot(tok::identifier)) {
+  PP.Diag(Tok, diag::warn_pragma_debug_unexpected_argument);
+  ConsumeAnyToken();
+  ExpectAndConsume(tok::eod);
+  return;
+}
+IdentifierInfo *II = Tok.getIdentifierInfo();
+Actions.ActOnPragmaDump(getCurScope(), Tok.getLocation(), II);
+ConsumeToken();
+  } else {
+SourceLocation StartLoc = Tok.getLocation();
+EnterExpressionEvaluationContext Ctx(
+  Actions, Sema::ExpressionEvaluationContext::Unevaluated);
+ExprResult E = ParseExpression();
+if (!E.isUsable() || E.get()->containsErrors()) {
+  // Diagnostics were emitted during parsing. No action needed.
+} else if (E.get()->getDependence() != ExprDependence::None) {
+  PP.Diag(StartLoc, diag::warn_pragma_debug_dependent_argument)
+<< E.get()->isTypeDependent()
+<< SourceRange(StartLoc, Tok.getLocation());
+} else {
+  Actions.ActOnPragmaDump(E.get());
+}
+SkipUntil(tok::eod, StopBeforeMatch);
+  }
+  ExpectAndConsume(tok::eod);
 

[PATCH] D145852: [Clang][AST] Fix __has_unique_object_representations computation for unnamed bitfields.

2023-03-11 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill accepted this revision.
Endill added a comment.
This revision is now accepted and ready to land.

LGTM
I got confused at first why this fix is done in a function named 
`getSubobjectSizeInBits`, and why do we calculate size to produce a boolean 
value in the end. Then I realized that this function returns number of bits of 
value representation, or `std::nullopt` if there are any padding bits, and we 
take advantage of the latter to implement `hasUniqueObjectRepresentations`. I 
guess I'm either missing some context or that function could be named better 
(not in this patch, of course).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145852/new/

https://reviews.llvm.org/D145852

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D144115: [clang] Extend pragma dump to support expressions

2023-03-13 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 504673.
Endill added a comment.

- Diagnose dependent expressions
- Move AST dumping from parser to sema
- Add documentation
- Add tests


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144115/new/

https://reviews.llvm.org/D144115

Files:
  clang/docs/LanguageExtensions.rst
  clang/include/clang/Basic/DiagnosticLexKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/Lex/Pragma.cpp
  clang/lib/Parse/ParsePragma.cpp
  clang/lib/Sema/SemaLookup.cpp
  clang/test/AST/ast-dump-lookups.cpp

Index: clang/test/AST/ast-dump-lookups.cpp
===
--- clang/test/AST/ast-dump-lookups.cpp
+++ clang/test/AST/ast-dump-lookups.cpp
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix DECLS %s
 // RUN: %clang_cc1 -std=c++11 -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix LOOKUPS %s
 // RUN: %clang_cc1 -std=c++11 -ast-dump -ast-dump-lookups -ast-dump-filter Test %s | FileCheck -check-prefix DECLS-LOOKUPS %s
-// RUN: %clang_cc1 -std=c++11 -DPRAGMA -fsyntax-only %s 2>&1 | FileCheck -check-prefix PRAGMA %s
+// RUN: %clang_cc1 -std=c++11 -DPRAGMA -fsyntax-only -verify %s 2>&1 | FileCheck -check-prefix PRAGMA %s
 
 namespace Test {
   typedef int T;
@@ -51,3 +51,32 @@
 //
 // DECLS-LOOKUPS: Dumping Test:
 // DECLS-LOOKUPS-NEXT: Lookup map is in primary DeclContext
+
+#ifdef PRAGMA
+namespace Test {
+  struct S {
+const S& operator+(const S&) { return *this; }
+  };
+  void foo(S) {}
+}
+
+#pragma clang __debug dump foo(Test::S{})
+// PRAGMA: CallExpr {{.*}} adl
+// PRAGMA-NEXT: |-ImplicitCastExpr {{.*}}
+// PRAGMA-NEXT: | `-DeclRefExpr {{.*}} 'void (S)' lvalue Function {{.*}} 'foo' 'void (S)'
+
+#pragma clang __debug dump Test::S{} + Test::S{}
+// PRAGMA: CXXOperatorCallExpr {{.*}}
+// PRAGMA-NEXT: |-ImplicitCastExpr {{.*}}
+// PRAGMA-NEXT: | `-DeclRefExpr {{.*}} 'const S &(const S &)' lvalue CXXMethod {{.*}} 'operator+' 'const S &(const S &)'
+
+#pragma clang __debug dump &Test::S::operator+
+// PRAGMA: UnaryOperator {{.*}}
+// PRAGMA-NEXT: `-DeclRefExpr {{.*}} 'const S &(const S &)' CXXMethod {{.*}} 'operator+' 'const S &(const S &)'
+
+template
+void bar() {
+#pragma clang __debug dump T{} // expected-warning {{type-dependent expression}}
+#pragma clang __debug dump +I  // expected-warning {{value-dependent expression}}
+}
+#endif
\ No newline at end of file
Index: clang/lib/Sema/SemaLookup.cpp
===
--- clang/lib/Sema/SemaLookup.cpp
+++ clang/lib/Sema/SemaLookup.cpp
@@ -5841,3 +5841,7 @@
   LookupName(R, S);
   R.dump();
 }
+
+void Sema::ActOnPragmaDump(Expr *E) {
+  E->dump();
+}
Index: clang/lib/Parse/ParsePragma.cpp
===
--- clang/lib/Parse/ParsePragma.cpp
+++ clang/lib/Parse/ParsePragma.cpp
@@ -13,6 +13,7 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/Basic/PragmaKinds.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Lex/LexDiagnostic.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Lex/Token.h"
 #include "clang/Parse/LoopHint.h"
@@ -706,10 +707,39 @@
 
 void Parser::HandlePragmaDump() {
   assert(Tok.is(tok::annot_pragma_dump));
-  IdentifierInfo *II =
-  reinterpret_cast(Tok.getAnnotationValue());
-  Actions.ActOnPragmaDump(getCurScope(), Tok.getLocation(), II);
   ConsumeAnnotationToken();
+  if (Tok.is(tok::eod)) {
+PP.Diag(Tok, diag::warn_pragma_debug_missing_argument) << "dump";
+  } else if (NextToken().is(tok::eod)) {
+if (Tok.isNot(tok::identifier)) {
+  PP.Diag(Tok, diag::warn_pragma_debug_unexpected_argument);
+  ConsumeAnyToken();
+  ExpectAndConsume(tok::eod);
+  return;
+}
+IdentifierInfo *II = Tok.getIdentifierInfo();
+Actions.ActOnPragmaDump(getCurScope(), Tok.getLocation(), II);
+ConsumeToken();
+  } else {
+SourceLocation StartLoc = Tok.getLocation();
+ExprResult E = ParseExpression();
+if (!E.isUsable()) {
+  PP.Diag(StartLoc, diag::warn_pragma_debug_unexpected_argument)
+<< SourceRange(StartLoc, Tok.getLocation());
+} else if (E.get()->containsErrors()) {
+  // Diagnostics were emitted during parsing. No action needed.
+} else if (E.get()->isTypeDependent()) {
+  PP.Diag(StartLoc, diag::warn_pragma_debug_type_dependent_argument)
+<< SourceRange(StartLoc, Tok.getLocation());
+} else if (E.get()->isValueDependent()) {
+  PP.Diag(StartLoc, diag::warn_pragma_debug_value_dependent_argument)
+<< SourceRange(StartLoc, Tok.getLocation());
+} else {
+  Actions.ActOnPragmaDump(E.get());
+}
+SkipUntil(tok::eod, StopBeforeMatch);
+  }
+  ExpectAndConsume(tok::eod);
 }
 
 void Parser::HandlePragmaWeak() {
Index: clang/lib/Lex/Pragma.cpp
===
--- clang/lib/Lex/Pragma.

[PATCH] D140996: [c++20] P1907R1: Support for generalized non-type template arguments of scalar type.

2023-03-13 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

In D140996#4189452 , @bolshakov-a 
wrote:

> Sorry! It's my first time using Phabricator. Maybe, the problem occurs 
> because I've solved the issue with Arcanist just by means of copy-pasting 
> patches into "Update Diff" Web GUI form.

There's nothing wrong with copy-pasting into web GUI form. You just have to 
export the patch with the right options, e.g. `git diff HEAD~1 -U99 > 
mypatch.patch` (more on this here 
).

> Maybe, I should reopen the PR?

You can simply update the review with properly exported patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140996/new/

https://reviews.llvm.org/D140996

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151697: [clang] Add test for CWG1710 and related issues

2023-06-23 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

ping


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151697/new/

https://reviews.llvm.org/D151697

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151634: [clang] Add test for CWG253

2023-06-25 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added inline comments.



Comment at: clang/test/CXX/drs/dr0xx.cpp:1022
 
-namespace dr78 { // dr78: sup 
+namespace dr78 { // dr78: no
   // Under DR78, this is valid, because 'k' has static storage duration, so is

shafik wrote:
> Endill wrote:
> > shafik wrote:
> > > shafik wrote:
> > > > This is [issue 1380](https://github.com/cplusplus/papers/issues/1380) 
> > > > and the issue is whether we want static initialization to happen before 
> > > > constant initialization or whether constant initialization excludes 
> > > > zero-init. 
> > > > 
> > > > I think dr77 is now part of [cwg 
> > > > 2536](https://cplusplus.github.io/CWG/issues/2536.html) and we need to 
> > > > wait for the resolution of that in order to know what to do here. 
> > > I was mistaken and completely missed: 
> > > https://eel.is/c++draft/dcl.init#general-8.sentence-2
> > > 
> > > DR 78 is just repeating what we have in: 
> > > https://eel.is/c++draft/basic.start#static
> > > 
> > > The wording has changed a lot since DR 78.
> > Can you please elaborate how does your conclusion affect this patch? 
> > Because I feel a bit lost at this point.
> > Was my initial analysis correct, and we should say that this DR is not 
> > available in Clang?
> No, so this DR was just clarifying that static objects will not have an 
> indeterminate value if they don't have an initializer. So we can consider 
> this NA or you can add a test with a static global w/o an init and show it 
> has zero value.
I'd like to focus on the following points:
1) test case is correct, because we're not supposed to issue a diagnostics for 
static objects without initializers
2) when we stop issuing a diagnostics, we should write a codegen test that 
ensures `k` is initialized with 0
3) this DR is not superseded, so we should mark it as `no`

Do you agree with everything above?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151634/new/

https://reviews.llvm.org/D151634

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151697: [clang] Add test for CWG1710 and related issues

2023-06-28 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill added a comment.

Thank you for taking a look!
I found a bunch of issues pointing at the same diagnostics, but I'm not sure if 
they track exactly what I test here:
https://github.com/llvm/llvm-project/issues/17775
https://github.com/llvm/llvm-project/issues/36539
https://github.com/llvm/llvm-project/issues/38395
https://github.com/llvm/llvm-project/issues/57019


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151697/new/

https://reviews.llvm.org/D151697

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147530: [clang] Add test for CWG191

2023-04-04 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : CWG191 and CWG1200 are resolved by defining 
unqualified lookup in terms of every enclosing scope.
Wording: If no declarations are found, the results of the unqualified search 
are the results of an unqualified search in the parent scope of S, if any, from 
P. ([basic.lookup.unqual]/2)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147530

Files:
  clang/test/CXX/drs/dr1xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1183,7 +1183,7 @@
 https://wg21.link/cwg191";>191
 CD6
 Name lookup does not handle complex nesting
-Unknown
+Yes
   
   
 https://wg21.link/cwg192";>192
Index: clang/test/CXX/drs/dr1xx.cpp
===
--- clang/test/CXX/drs/dr1xx.cpp
+++ clang/test/CXX/drs/dr1xx.cpp
@@ -999,6 +999,36 @@
 
 // dr190 FIXME: add codegen test for tbaa
 
+int dr191_j;
+namespace dr191 { // dr191: yes
+  namespace example1 {
+struct outer {
+  static int i;
+  struct inner {
+void f() {
+  struct local {
+void g() {
+  i = 5;
+}
+  };
+}
+  };
+};
+  }
+
+  namespace example2 {
+struct S {
+  void f() {
+struct local2 {
+  void g() {
+dr191_j = 5;
+  }
+};
+  }
+};
+  }
+}
+
 // dr193 FIXME: add codegen test
 
 namespace dr194 { // dr194: yes


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1183,7 +1183,7 @@
 https://wg21.link/cwg191";>191
 CD6
 Name lookup does not handle complex nesting
-Unknown
+Yes
   
   
 https://wg21.link/cwg192";>192
Index: clang/test/CXX/drs/dr1xx.cpp
===
--- clang/test/CXX/drs/dr1xx.cpp
+++ clang/test/CXX/drs/dr1xx.cpp
@@ -999,6 +999,36 @@
 
 // dr190 FIXME: add codegen test for tbaa
 
+int dr191_j;
+namespace dr191 { // dr191: yes
+  namespace example1 {
+struct outer {
+  static int i;
+  struct inner {
+void f() {
+  struct local {
+void g() {
+  i = 5;
+}
+  };
+}
+  };
+};
+  }
+
+  namespace example2 {
+struct S {
+  void f() {
+struct local2 {
+  void g() {
+dr191_j = 5;
+  }
+};
+  }
+};
+  }
+}
+
 // dr193 FIXME: add codegen test
 
 namespace dr194 { // dr194: yes
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147530: [clang] Add test for CWG191

2023-04-04 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill updated this revision to Diff 510793.
Endill edited the summary of this revision.
Endill added a comment.

Mark CWG1200 as "na" and enable newer standard versions in RUN lines


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147530/new/

https://reviews.llvm.org/D147530

Files:
  clang/test/CXX/drs/dr12xx.cpp
  clang/test/CXX/drs/dr1xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1183,7 +1183,7 @@
 https://wg21.link/cwg191";>191
 CD6
 Name lookup does not handle complex nesting
-Unknown
+Yes
   
   
 https://wg21.link/cwg192";>192
@@ -7007,7 +7007,7 @@
 https://wg21.link/cwg1200";>1200
 CD6
 Lookup rules for template parameters
-Unknown
+N/A
   
   
 https://wg21.link/cwg1201";>1201
Index: clang/test/CXX/drs/dr1xx.cpp
===
--- clang/test/CXX/drs/dr1xx.cpp
+++ clang/test/CXX/drs/dr1xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
 
 namespace dr100 { // dr100: yes
   template struct A {}; // expected-note 0-1{{declared 
here}}
@@ -999,6 +1000,36 @@
 
 // dr190 FIXME: add codegen test for tbaa
 
+int dr191_j;
+namespace dr191 { // dr191: yes
+  namespace example1 {
+struct outer {
+  static int i;
+  struct inner {
+void f() {
+  struct local {
+void g() {
+  i = 5;
+}
+  };
+}
+  };
+};
+  }
+
+  namespace example2 {
+struct S {
+  void f() {
+struct local2 {
+  void g() {
+dr191_j = 5;
+  }
+};
+  }
+};
+  }
+}
+
 // dr193 FIXME: add codegen test
 
 namespace dr194 { // dr194: yes
Index: clang/test/CXX/drs/dr12xx.cpp
===
--- clang/test/CXX/drs/dr12xx.cpp
+++ clang/test/CXX/drs/dr12xx.cpp
@@ -1,7 +1,11 @@
 // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
-// RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+
+// dr1200: na
 
 namespace dr1213 { // dr1213: 7
 #if __cplusplus >= 201103L


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1183,7 +1183,7 @@
 https://wg21.link/cwg191";>191
 CD6
 Name lookup does not handle complex nesting
-Unknown
+Yes
   
   
 https://wg21.link/cwg192";>192
@@ -7007,7 +7007,7 @@
 https://wg21.link/cwg1200";>1200
 CD6
 Lookup rules for template parameters
-Unknown
+N/A
   
   
 https://wg21.link/cwg1201";>1201
Index: clang/test/CXX/drs/dr1xx.cpp
===
--- clang/test/CXX/drs/dr1xx.cpp
+++ clang/test/CXX/drs/dr1xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 namespace dr100 { // dr100: yes
   template struct A {}; // expected-note 0-1{{declared here}}
@@ -999,6 +1000,36 @@
 
 // dr190 FIXME: add codegen test for tbaa
 
+int dr191_j;
+namespace dr191 { // dr191: yes
+  namespace example1 {
+struct outer {
+  static int i;
+  struct inner {
+void f() {
+  struct local {
+void g() {
+  i = 5;
+}
+  };
+}
+  };
+};
+  }
+
+  namespace example2 {
+struct S {
+  void f() {
+struct local2 {
+  void g()

[PATCH] D147549: [clang] Add test for CWG255

2023-04-04 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : CWG255 (partially resolved by N3778 is 
resolved by generally specifying the restriction to usual deallocation 
functions.
Wording: In any case, any declarations other than of usual deallocation 
functions ([basic.stc.dynamic.deallocation]) are discarded. ([expr.delete]/9)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147549

Files:
  clang/test/CXX/drs/dr2xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1568,7 +1568,7 @@
 https://wg21.link/cwg255";>255
 CD6
 Placement deallocation functions and lookup ambiguity
-Unknown
+Yes
   
   
 https://wg21.link/cwg256";>256
Index: clang/test/CXX/drs/dr2xx.cpp
===
--- clang/test/CXX/drs/dr2xx.cpp
+++ clang/test/CXX/drs/dr2xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 
 // PR13819 -- __SIZE_TYPE__ is incompatible.
 typedef __SIZE_TYPE__ size_t; // expected-error 0-1 {{extension}}
@@ -692,6 +693,14 @@
   A::type n; // expected-note {{instantiation of}}
 }
 
+namespace dr255 { // dr255: yes
+struct S {
+  void operator delete(void *){};
+  void operator delete(void *, int){};
+};
+void f(S *p) { delete p; }
+} // namespace dr255
+
 // dr256: dup 624
 
 namespace dr257 { // dr257: yes


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1568,7 +1568,7 @@
 https://wg21.link/cwg255";>255
 CD6
 Placement deallocation functions and lookup ambiguity
-Unknown
+Yes
   
   
 https://wg21.link/cwg256";>256
Index: clang/test/CXX/drs/dr2xx.cpp
===
--- clang/test/CXX/drs/dr2xx.cpp
+++ clang/test/CXX/drs/dr2xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 // PR13819 -- __SIZE_TYPE__ is incompatible.
 typedef __SIZE_TYPE__ size_t; // expected-error 0-1 {{extension}}
@@ -692,6 +693,14 @@
   A::type n; // expected-note {{instantiation of}}
 }
 
+namespace dr255 { // dr255: yes
+struct S {
+  void operator delete(void *){};
+  void operator delete(void *, int){};
+};
+void f(S *p) { delete p; }
+} // namespace dr255
+
 // dr256: dup 624
 
 namespace dr257 { // dr257: yes
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147554: [clang] Mark CWG562 as N/A

2023-04-04 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : CWG562 is resolved by defining lookup as 
occurring from a program point.
Wording: A single search in a scope S for a name N from a program point P finds 
all declarations that precede P to which any name that is the same as N 
([basic.pre]) is bound in S. ([basic.lookup]/2)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147554

Files:
  clang/test/CXX/drs/dr5xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3413,7 +3413,7 @@
 https://wg21.link/cwg562";>562
 CD6
 qualified-ids in non-expression contexts
-Unknown
+N/A
   
   
 https://wg21.link/cwg563";>563
Index: clang/test/CXX/drs/dr5xx.cpp
===
--- clang/test/CXX/drs/dr5xx.cpp
+++ clang/test/CXX/drs/dr5xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 
 // FIXME: This is included to avoid a diagnostic with no source location
 // pointing at the implicit operator new. We can't match such a diagnostic
@@ -643,6 +644,8 @@
   }
 }
 
+// dr562: na
+
 namespace dr564 { // dr564: yes
   extern "C++" void f(int);
   void f(int); // ok


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3413,7 +3413,7 @@
 https://wg21.link/cwg562";>562
 CD6
 qualified-ids in non-expression contexts
-Unknown
+N/A
   
   
 https://wg21.link/cwg563";>563
Index: clang/test/CXX/drs/dr5xx.cpp
===
--- clang/test/CXX/drs/dr5xx.cpp
+++ clang/test/CXX/drs/dr5xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 // FIXME: This is included to avoid a diagnostic with no source location
 // pointing at the implicit operator new. We can't match such a diagnostic
@@ -643,6 +644,8 @@
   }
 }
 
+// dr562: na
+
 namespace dr564 { // dr564: yes
   extern "C++" void f(int);
   void f(int); // ok
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147564: [clang] Mark CWG536 as N/A

2023-04-04 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : CWG536 (long partially resolved) is resolved 
by specifying that unqualified lookup occurs for any kind of unqualified-id as 
an id-expression.
Wording: An unqualified name is a name that <...>. Unless otherwise specified, 
such a name undergoes unqualified name lookup from the point where it appears. 
([basic.lookup.unqual]/4)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147564

Files:
  clang/test/CXX/drs/dr5xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3255,7 +3255,7 @@
 https://wg21.link/cwg536";>536
 CD6
 Problems in the description of id-expressions
-Unknown
+N/A
   
   
 https://wg21.link/cwg537";>537
Index: clang/test/CXX/drs/dr5xx.cpp
===
--- clang/test/CXX/drs/dr5xx.cpp
+++ clang/test/CXX/drs/dr5xx.cpp
@@ -417,6 +417,7 @@
 #endif
 }
 
+// dr536: na
 // dr537: na
 // dr538: na
 


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3255,7 +3255,7 @@
 https://wg21.link/cwg536";>536
 CD6
 Problems in the description of id-expressions
-Unknown
+N/A
   
   
 https://wg21.link/cwg537";>537
Index: clang/test/CXX/drs/dr5xx.cpp
===
--- clang/test/CXX/drs/dr5xx.cpp
+++ clang/test/CXX/drs/dr5xx.cpp
@@ -417,6 +417,7 @@
 #endif
 }
 
+// dr536: na
 // dr537: na
 // dr538: na
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147590: [clang] Add test for CWG607

2023-04-04 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : CWG607 is resolved by looking up unqualified 
names in a mem-initializer-id from outside the parameter scope.
Wording: Lookup for an unqualified name in a mem-initializer-id ignores the 
constructor’s function parameter scope. ([class.base.init]/2)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147590

Files:
  clang/test/CXX/drs/dr6xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3683,7 +3683,7 @@
 https://wg21.link/cwg607";>607
 CD6
 Lookup of mem-initializer-ids
-Unknown
+Yes
   
   
 https://wg21.link/cwg608";>608
Index: clang/test/CXX/drs/dr6xx.cpp
===
--- clang/test/CXX/drs/dr6xx.cpp
+++ clang/test/CXX/drs/dr6xx.cpp
@@ -100,6 +100,34 @@
 #endif
 }
 
+namespace dr607 { // dr607: yes
+namespace example1 {
+struct Y {};
+
+template  struct X : public virtual Y {};
+
+template  class A : public X {
+  template  A(S) : S() {}
+};
+
+template A::A(Y);
+} // namespace example1
+
+namespace example2 {
+namespace N {
+struct B {
+  B(int);
+};
+typedef B typedef_B;
+struct D : B {
+  D();
+};
+} // namespace N
+
+N::D::D() : typedef_B(0) {}
+} // namespace example2
+} // namespace dr607
+
 namespace dr608 { // dr608: yes
   struct A { virtual void f(); };
   struct B : A {};


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3683,7 +3683,7 @@
 https://wg21.link/cwg607";>607
 CD6
 Lookup of mem-initializer-ids
-Unknown
+Yes
   
   
 https://wg21.link/cwg608";>608
Index: clang/test/CXX/drs/dr6xx.cpp
===
--- clang/test/CXX/drs/dr6xx.cpp
+++ clang/test/CXX/drs/dr6xx.cpp
@@ -100,6 +100,34 @@
 #endif
 }
 
+namespace dr607 { // dr607: yes
+namespace example1 {
+struct Y {};
+
+template  struct X : public virtual Y {};
+
+template  class A : public X {
+  template  A(S) : S() {}
+};
+
+template A::A(Y);
+} // namespace example1
+
+namespace example2 {
+namespace N {
+struct B {
+  B(int);
+};
+typedef B typedef_B;
+struct D : B {
+  D();
+};
+} // namespace N
+
+N::D::D() : typedef_B(0) {}
+} // namespace example2
+} // namespace dr607
+
 namespace dr608 { // dr608: yes
   struct A { virtual void f(); };
   struct B : A {};
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147530: [clang] Add test for CWG191

2023-04-07 Thread Vlad Serebrennikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG653a82e95257: [clang] Add test for CWG191 (authored by 
Endill).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147530/new/

https://reviews.llvm.org/D147530

Files:
  clang/test/CXX/drs/dr12xx.cpp
  clang/test/CXX/drs/dr1xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1183,7 +1183,7 @@
 https://wg21.link/cwg191";>191
 CD6
 Name lookup does not handle complex nesting
-Unknown
+Yes
   
   
 https://wg21.link/cwg192";>192
@@ -7007,7 +7007,7 @@
 https://wg21.link/cwg1200";>1200
 CD6
 Lookup rules for template parameters
-Unknown
+N/A
   
   
 https://wg21.link/cwg1201";>1201
Index: clang/test/CXX/drs/dr1xx.cpp
===
--- clang/test/CXX/drs/dr1xx.cpp
+++ clang/test/CXX/drs/dr1xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
 
 namespace dr100 { // dr100: yes
   template struct A {}; // expected-note 0-1{{declared 
here}}
@@ -999,6 +1000,36 @@
 
 // dr190 FIXME: add codegen test for tbaa
 
+int dr191_j;
+namespace dr191 { // dr191: yes
+  namespace example1 {
+struct outer {
+  static int i;
+  struct inner {
+void f() {
+  struct local {
+void g() {
+  i = 5;
+}
+  };
+}
+  };
+};
+  }
+
+  namespace example2 {
+struct S {
+  void f() {
+struct local2 {
+  void g() {
+dr191_j = 5;
+  }
+};
+  }
+};
+  }
+}
+
 // dr193 FIXME: add codegen test
 
 namespace dr194 { // dr194: yes
Index: clang/test/CXX/drs/dr12xx.cpp
===
--- clang/test/CXX/drs/dr12xx.cpp
+++ clang/test/CXX/drs/dr12xx.cpp
@@ -1,7 +1,11 @@
 // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
-// RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+
+// dr1200: na
 
 namespace dr1213 { // dr1213: 7
 #if __cplusplus >= 201103L


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1183,7 +1183,7 @@
 https://wg21.link/cwg191";>191
 CD6
 Name lookup does not handle complex nesting
-Unknown
+Yes
   
   
 https://wg21.link/cwg192";>192
@@ -7007,7 +7007,7 @@
 https://wg21.link/cwg1200";>1200
 CD6
 Lookup rules for template parameters
-Unknown
+N/A
   
   
 https://wg21.link/cwg1201";>1201
Index: clang/test/CXX/drs/dr1xx.cpp
===
--- clang/test/CXX/drs/dr1xx.cpp
+++ clang/test/CXX/drs/dr1xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 namespace dr100 { // dr100: yes
   template struct A {}; // expected-note 0-1{{declared here}}
@@ -999,6 +1000,36 @@
 
 // dr190 FIXME: add codegen test for tbaa
 
+int dr191_j;
+namespace dr191 { // dr191: yes
+  namespace example1 {
+struct outer {
+  static int i;
+  struct inner {
+void f() {
+  struct local {
+void g() {
+  i = 5;
+}
+  };
+}
+  };
+};
+  }
+
+  namespace example2 {
+struct S {
+  void f() {
+struct local2 {
+  void g() {
+dr191_j = 

[PATCH] D147549: [clang] Add test for CWG255

2023-04-07 Thread Vlad Serebrennikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG33e84315e7d6: [clang] Add test for CWG255 (authored by 
Endill).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147549/new/

https://reviews.llvm.org/D147549

Files:
  clang/test/CXX/drs/dr2xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1568,7 +1568,7 @@
 https://wg21.link/cwg255";>255
 CD6
 Placement deallocation functions and lookup ambiguity
-Unknown
+Yes
   
   
 https://wg21.link/cwg256";>256
Index: clang/test/CXX/drs/dr2xx.cpp
===
--- clang/test/CXX/drs/dr2xx.cpp
+++ clang/test/CXX/drs/dr2xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 
 // PR13819 -- __SIZE_TYPE__ is incompatible.
 typedef __SIZE_TYPE__ size_t; // expected-error 0-1 {{extension}}
@@ -692,6 +693,14 @@
   A::type n; // expected-note {{instantiation of}}
 }
 
+namespace dr255 { // dr255: yes
+struct S {
+  void operator delete(void *){};
+  void operator delete(void *, int){};
+};
+void f(S *p) { delete p; }
+} // namespace dr255
+
 // dr256: dup 624
 
 namespace dr257 { // dr257: yes


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -1568,7 +1568,7 @@
 https://wg21.link/cwg255";>255
 CD6
 Placement deallocation functions and lookup ambiguity
-Unknown
+Yes
   
   
 https://wg21.link/cwg256";>256
Index: clang/test/CXX/drs/dr2xx.cpp
===
--- clang/test/CXX/drs/dr2xx.cpp
+++ clang/test/CXX/drs/dr2xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 // PR13819 -- __SIZE_TYPE__ is incompatible.
 typedef __SIZE_TYPE__ size_t; // expected-error 0-1 {{extension}}
@@ -692,6 +693,14 @@
   A::type n; // expected-note {{instantiation of}}
 }
 
+namespace dr255 { // dr255: yes
+struct S {
+  void operator delete(void *){};
+  void operator delete(void *, int){};
+};
+void f(S *p) { delete p; }
+} // namespace dr255
+
 // dr256: dup 624
 
 namespace dr257 { // dr257: yes
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147554: [clang] Mark CWG562 as N/A

2023-04-07 Thread Vlad Serebrennikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG154825bdf6fb: [clang] Mark CWG562 as N/A (authored by 
Endill).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147554/new/

https://reviews.llvm.org/D147554

Files:
  clang/test/CXX/drs/dr5xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3413,7 +3413,7 @@
 https://wg21.link/cwg562";>562
 CD6
 qualified-ids in non-expression contexts
-Unknown
+N/A
   
   
 https://wg21.link/cwg563";>563
Index: clang/test/CXX/drs/dr5xx.cpp
===
--- clang/test/CXX/drs/dr5xx.cpp
+++ clang/test/CXX/drs/dr5xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions 
-pedantic-errors
 
 // FIXME: This is included to avoid a diagnostic with no source location
 // pointing at the implicit operator new. We can't match such a diagnostic
@@ -643,6 +644,8 @@
   }
 }
 
+// dr562: na
+
 namespace dr564 { // dr564: yes
   extern "C++" void f(int);
   void f(int); // ok


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3413,7 +3413,7 @@
 https://wg21.link/cwg562";>562
 CD6
 qualified-ids in non-expression contexts
-Unknown
+N/A
   
   
 https://wg21.link/cwg563";>563
Index: clang/test/CXX/drs/dr5xx.cpp
===
--- clang/test/CXX/drs/dr5xx.cpp
+++ clang/test/CXX/drs/dr5xx.cpp
@@ -3,6 +3,7 @@
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 // FIXME: This is included to avoid a diagnostic with no source location
 // pointing at the implicit operator new. We can't match such a diagnostic
@@ -643,6 +644,8 @@
   }
 }
 
+// dr562: na
+
 namespace dr564 { // dr564: yes
   extern "C++" void f(int);
   void f(int); // ok
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147590: [clang] Add test for CWG607

2023-04-07 Thread Vlad Serebrennikov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4b0386940255: [clang] Add test for CWG607 (authored by 
Endill).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147590/new/

https://reviews.llvm.org/D147590

Files:
  clang/test/CXX/drs/dr6xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3683,7 +3683,7 @@
 https://wg21.link/cwg607";>607
 CD6
 Lookup of mem-initializer-ids
-Unknown
+Yes
   
   
 https://wg21.link/cwg608";>608
Index: clang/test/CXX/drs/dr6xx.cpp
===
--- clang/test/CXX/drs/dr6xx.cpp
+++ clang/test/CXX/drs/dr6xx.cpp
@@ -100,6 +100,34 @@
 #endif
 }
 
+namespace dr607 { // dr607: yes
+namespace example1 {
+struct Y {};
+
+template  struct X : public virtual Y {};
+
+template  class A : public X {
+  template  A(S) : S() {}
+};
+
+template A::A(Y);
+} // namespace example1
+
+namespace example2 {
+namespace N {
+struct B {
+  B(int);
+};
+typedef B typedef_B;
+struct D : B {
+  D();
+};
+} // namespace N
+
+N::D::D() : typedef_B(0) {}
+} // namespace example2
+} // namespace dr607
+
 namespace dr608 { // dr608: yes
   struct A { virtual void f(); };
   struct B : A {};


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -3683,7 +3683,7 @@
 https://wg21.link/cwg607";>607
 CD6
 Lookup of mem-initializer-ids
-Unknown
+Yes
   
   
 https://wg21.link/cwg608";>608
Index: clang/test/CXX/drs/dr6xx.cpp
===
--- clang/test/CXX/drs/dr6xx.cpp
+++ clang/test/CXX/drs/dr6xx.cpp
@@ -100,6 +100,34 @@
 #endif
 }
 
+namespace dr607 { // dr607: yes
+namespace example1 {
+struct Y {};
+
+template  struct X : public virtual Y {};
+
+template  class A : public X {
+  template  A(S) : S() {}
+};
+
+template A::A(Y);
+} // namespace example1
+
+namespace example2 {
+namespace N {
+struct B {
+  B(int);
+};
+typedef B typedef_B;
+struct D : B {
+  D();
+};
+} // namespace N
+
+N::D::D() : typedef_B(0) {}
+} // namespace example2
+} // namespace dr607
+
 namespace dr608 { // dr608: yes
   struct A { virtual void f(); };
   struct B : A {};
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147836: [clang] Add test for CWG1822

2023-04-07 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : CWG1822 is resolved by specifying that the 
body of a lambda remains in the surrounding (function parameter) scope.
Wording: A parameter-declaration-clause P introduces a function parameter scope 
that includes P. <...> If P is associated with a lambda-declarator, its scope 
extends to the end of the compound-statement in the lambda-expression. 
([basic.scope.param])


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147836

Files:
  clang/test/CXX/drs/dr18xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -10739,7 +10739,7 @@
 https://wg21.link/cwg1822";>1822
 CD6
 Lookup of parameter names in lambda-expressions
-Unknown
+Yes
   
   
 https://wg21.link/cwg1823";>1823
Index: clang/test/CXX/drs/dr18xx.cpp
===
--- clang/test/CXX/drs/dr18xx.cpp
+++ clang/test/CXX/drs/dr18xx.cpp
@@ -50,6 +50,15 @@
 #endif
 }
 
+namespace dr1822 { // dr1822: yes
+#if __cplusplus >= 201103L
+  int a;
+  auto x = [] (int a) {
+#pragma clang __debug dump a // CHECK: ParmVarDecl
+  };
+#endif
+}
+
 namespace dr1872 { // dr1872: 9
 #if __cplusplus >= 201103L
   template struct A : T {


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -10739,7 +10739,7 @@
 https://wg21.link/cwg1822";>1822
 CD6
 Lookup of parameter names in lambda-expressions
-Unknown
+Yes
   
   
 https://wg21.link/cwg1823";>1823
Index: clang/test/CXX/drs/dr18xx.cpp
===
--- clang/test/CXX/drs/dr18xx.cpp
+++ clang/test/CXX/drs/dr18xx.cpp
@@ -50,6 +50,15 @@
 #endif
 }
 
+namespace dr1822 { // dr1822: yes
+#if __cplusplus >= 201103L
+  int a;
+  auto x = [] (int a) {
+#pragma clang __debug dump a // CHECK: ParmVarDecl
+  };
+#endif
+}
+
 namespace dr1872 { // dr1872: 9
 #if __cplusplus >= 201103L
   template struct A : T {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147839: [clang] Add test for CWG2007

2023-04-07 Thread Vlad Serebrennikov via Phabricator via cfe-commits
Endill created this revision.
Endill added a reviewer: clang-language-wg.
Herald added a project: All.
Endill requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

P1787 : CWG2007 is resolved by skipping unqualified 
lookup for operators that must be member functions.
Wording: For the operators =, [], or ->, the set of non-member candidates is 
empty; otherwise, it includes the result of the unqualified lookup for 
operator@... ([over.match.oper]/3)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147839

Files:
  clang/test/CXX/drs/dr20xx.cpp
  clang/www/cxx_dr_status.html


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -11849,7 +11849,7 @@
 https://wg21.link/cwg2007";>2007
 CD6
 Argument-dependent lookup for operator=
-Unknown
+Partial
   
   
 https://wg21.link/cwg2008";>2008
Index: clang/test/CXX/drs/dr20xx.cpp
===
--- clang/test/CXX/drs/dr20xx.cpp
+++ clang/test/CXX/drs/dr20xx.cpp
@@ -3,12 +3,23 @@
 // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++2a -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify 
-fexceptions -fcxx-exceptions -pedantic-errors
 
 #if __cplusplus < 201103L
 #define static_assert(...) _Static_assert(__VA_ARGS__)
 #endif
 
+namespace dr2007 { // dr2007: partial
+template struct A { typename T::error e; };
+template struct B { };
+B > b1;
+B > b2 = b1;
+int a = b2[0]; // expected-error {{does not provide a subscript operator}}
+// FIXME: the following code shouldn't instantiate A.
+// int b = (&b2)->foo;
+}
+
 namespace dr2026 { // dr2026: 11
   template struct X {};
 


Index: clang/www/cxx_dr_status.html
===
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -11849,7 +11849,7 @@
 https://wg21.link/cwg2007";>2007
 CD6
 Argument-dependent lookup for operator=
-Unknown
+Partial
   
   
 https://wg21.link/cwg2008";>2008
Index: clang/test/CXX/drs/dr20xx.cpp
===
--- clang/test/CXX/drs/dr20xx.cpp
+++ clang/test/CXX/drs/dr20xx.cpp
@@ -3,12 +3,23 @@
 // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++2a -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 #if __cplusplus < 201103L
 #define static_assert(...) _Static_assert(__VA_ARGS__)
 #endif
 
+namespace dr2007 { // dr2007: partial
+template struct A { typename T::error e; };
+template struct B { };
+B > b1;
+B > b2 = b1;
+int a = b2[0]; // expected-error {{does not provide a subscript operator}}
+// FIXME: the following code shouldn't instantiate A.
+// int b = (&b2)->foo;
+}
+
 namespace dr2026 { // dr2026: 11
   template struct X {};
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


  1   2   3   >