[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 = 5;
+

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

2023-04-04 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik accepted this revision.
shafik added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147530

___
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] 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