llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Vlad Serebrennikov (Endilll)

<details>
<summary>Changes</summary>

This is a follow-up to #<!-- -->179674, which applies various fixes across C++ 
DR tests uncovered by `-verify-directives` (#<!-- -->179835
).

Changes here serve double duty. First, they fix actual problems found by 
`-verify-directives`, because I've been manually enforcing those rules manually 
for quite a while. Second, they show typical problems and possible solutions 
when you opt-in a test to use `-verify-directives`. This PR focuses on 
interesting cases, as partial diagnostic matches, which are trivial to fix, are 
fixed in boring #<!-- -->179674

Changes include:
1. Getting rid of instantiations at the end of TU that emit diagnostics: either 
trigger them earlier, or move them to a separate file
2. Reordering of `expected-error` and `expected-note` to match the order in 
which corresponding diagnsotics are emitted.
3. Eliminating leftover partial matches of diagnostic text
4. Removing some extension warnings, because C++ DR tests are not interested in 
features backported to older language modes.
5. Fix for a hilarious case of CWG413 test, which was checking for a note from 
a typo correction that happened in another test.


---

Patch is 110.03 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/179813.diff


26 Files Affected:

- (modified) clang/test/CXX/drs/cwg0xx.cpp (+7-32) 
- (modified) clang/test/CXX/drs/cwg10xx.cpp (+10-9) 
- (modified) clang/test/CXX/drs/cwg13xx.cpp (+26-41) 
- (modified) clang/test/CXX/drs/cwg15xx.cpp (+47-31) 
- (modified) clang/test/CXX/drs/cwg16xx.cpp (+11-9) 
- (added) clang/test/CXX/drs/cwg1736.cpp (+28) 
- (modified) clang/test/CXX/drs/cwg17xx.cpp (+1-18) 
- (modified) clang/test/CXX/drs/cwg18xx.cpp (+4-4) 
- (modified) clang/test/CXX/drs/cwg1xx.cpp (+24-25) 
- (added) clang/test/CXX/drs/cwg2026.cpp (+71) 
- (modified) clang/test/CXX/drs/cwg20xx.cpp (+14-83) 
- (added) clang/test/CXX/drs/cwg2406.cpp (+44) 
- (modified) clang/test/CXX/drs/cwg24xx.cpp (+1-34) 
- (modified) clang/test/CXX/drs/cwg25xx.cpp (+11-14) 
- (added) clang/test/CXX/drs/cwg2881.cpp (+147) 
- (modified) clang/test/CXX/drs/cwg28xx.cpp (+1-137) 
- (modified) clang/test/CXX/drs/cwg2xx.cpp (+1-4) 
- (added) clang/test/CXX/drs/cwg329.cpp (+27) 
- (added) clang/test/CXX/drs/cwg390.cpp (+26) 
- (modified) clang/test/CXX/drs/cwg3xx.cpp (+46-74) 
- (modified) clang/test/CXX/drs/cwg4xx.cpp (+26-15) 
- (modified) clang/test/CXX/drs/cwg5xx.cpp (+14-9) 
- (modified) clang/test/CXX/drs/cwg6xx.cpp (+23-22) 
- (modified) clang/test/CXX/drs/cwg7xx.cpp (+49-40) 
- (added) clang/test/CXX/drs/cwg98.cpp (+35) 
- (modified) clang/test/CXX/drs/cwg9xx.cpp (+18-14) 


``````````diff
diff --git a/clang/test/CXX/drs/cwg0xx.cpp b/clang/test/CXX/drs/cwg0xx.cpp
index 6d3a3238d4f38..793ef5c7e2fdb 100644
--- a/clang/test/CXX/drs/cwg0xx.cpp
+++ b/clang/test/CXX/drs/cwg0xx.cpp
@@ -484,7 +484,7 @@ namespace cwg33 { // cwg33: 9
 
   template<typename T> void t(X::S);
   template<typename T, typename U = void> void u(X::S);
-  // expected-error@-1 0-1 {{default template arguments for a function 
template are a C++11 extension}}
+  // cxx98-error@-1 {{default template arguments for a function template are a 
C++11 extension}}
   void templ() { f(t<int>); f(u<int>); }
 
   // Even though v<int> cannot select the first overload, ADL considers it
@@ -1042,16 +1042,16 @@ namespace cwg62 { // cwg62: 2.9
   //   cxx98-note@#cwg62-unnamed {{unnamed type used in template argument was 
declared here}}
   NoNameForLinkagePtr p1 = get<NoNameForLinkagePtr>();
   // cxx98-error@-1 {{template argument uses unnamed type}}
+  //   cxx98-note@-2 {{while substituting explicitly-specified template 
arguments into function template 'get'}}
   //   cxx98-note@#cwg62-unnamed {{unnamed type used in template argument was 
declared here}}
-  //   cxx98-note@-3 {{while substituting explicitly-specified template 
arguments}}
   NoNameForLinkagePtr p2 = get<const NoNameForLinkagePtr>();
   // cxx98-error@-1 {{template argument uses unnamed type}}
+  //   cxx98-note@-2 {{while substituting explicitly-specified template 
arguments into function template 'get'}}
   //   cxx98-note@#cwg62-unnamed {{unnamed type used in template argument was 
declared here}}
-  //   cxx98-note@-3 {{while substituting explicitly-specified template 
arguments}}
   int n1 = take(noNameForLinkagePtr);
   // cxx98-error@-1 {{template argument uses unnamed type}}
+  //   cxx98-note@-2 {{while substituting deduced template arguments into 
function template 'take' [with T = NoNameForLinkagePtr]}}
   //   cxx98-note@#cwg62-unnamed {{unnamed type used in template argument was 
declared here}}
-  //   cxx98-note@-3 {{while substituting deduced template arguments}}
 
   X<Danger> x4;
 
@@ -1378,9 +1378,10 @@ namespace cwg92 { // cwg92: 4 c++17
   // considered in this context. In C++17, we *do* perform an implicit
   // conversion (which performs initialization), and the exception 
specification
   // is part of the type of the parameter, so this is invalid.
-  template<void() throw()> struct X {}; // since-cxx17-note {{template 
parameter is declared here}}
+  template<void() throw()> struct X {}; // #cwg92-X
   X<&f> xp;
   // since-cxx17-error@-1 {{value of type 'void (*)() throw(int, float)' is 
not implicitly convertible to 'void (*)() throw()'}}
+  //   since-cxx17-note@#cwg92-X {{template parameter is declared here}}
 
   template<void() throw(int)> struct Y {};
   // since-cxx17-error@-1 {{ISO C++17 does not allow dynamic exception 
specifications}}
@@ -1440,33 +1441,7 @@ namespace cwg97 { // cwg97: 2.7
   };
 } // namespace cwg97
 
-namespace cwg98 { // cwg98: 2.7
-  void test(int n) {
-    switch (n) {
-      try { // #cwg98-try
-        case 0:
-        // expected-error@-1 {{cannot jump from switch statement to this case 
label}}
-        //   expected-note@#cwg98-try {{jump bypasses initialization of try 
block}}
-        x:
-          throw n;
-      } catch (...) { // #cwg98-catch
-        case 1:
-        // expected-error@-1 {{cannot jump from switch statement to this case 
label}}
-        //   expected-note@#cwg98-catch {{jump bypasses initialization of 
catch block}}
-        y:
-          throw n;
-      }
-      case 2:
-        goto x;
-        // expected-error@-1 {{cannot jump from this goto statement to its 
label}}
-        //   expected-note@#cwg98-try {{jump bypasses initialization of try 
block}}
-      case 3:
-        goto y;
-        // expected-error@-1 {{cannot jump from this goto statement to its 
label}}
-        //   expected-note@#cwg98-catch {{jump bypasses initialization of 
catch block}}
-    }
-  }
-} // namespace cwg98
+// cwg98 is in cwg98.cpp
 
 namespace cwg99 { // cwg99: sup 214
   template<typename T> void f(T&);
diff --git a/clang/test/CXX/drs/cwg10xx.cpp b/clang/test/CXX/drs/cwg10xx.cpp
index c5b96c4ab8ffc..f0aaa174d6c06 100644
--- a/clang/test/CXX/drs/cwg10xx.cpp
+++ b/clang/test/CXX/drs/cwg10xx.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -std=c++98 %s -verify=expected -fexceptions 
-fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++11 %s -verify=expected -fexceptions 
-fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++14 %s -verify=expected,since-cxx14 -fexceptions 
-fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++17 %s -verify=expected,since-cxx14 -fexceptions 
-fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++20 %s -verify=expected,since-cxx14 -fexceptions 
-fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++23 %s -verify=expected,since-cxx14 -fexceptions 
-fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++2c %s -verify=expected,since-cxx14 -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=expected,since-cxx11 -fexceptions 
-fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++14 %s -verify=expected,since-cxx11,since-cxx14 
-fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++17 %s -verify=expected,since-cxx11,since-cxx14 
-fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++20 %s -verify=expected,since-cxx11,since-cxx14 
-fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++23 %s -verify=expected,since-cxx11,since-cxx14 
-fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2c %s -verify=expected,since-cxx11,since-cxx14 
-fexceptions -fcxx-exceptions -pedantic-errors
 
 namespace std {
   __extension__ typedef __SIZE_TYPE__ size_t;
@@ -41,8 +41,9 @@ namespace cwg1004 { // cwg1004: 5
   // This example (from the standard) is actually ill-formed, because
   // name lookup of "T::template A" names the constructor.
   template<class T, template<class> class U = T::template A> struct Third { };
-  // expected-error@-1 {{is a constructor name}}
-  //   expected-note@#cwg1004-t {{in instantiation of default argument}}
+  // expected-error@-1 {{ISO C++ specifies that qualified reference to 'A' is 
a constructor name rather than a template name in this context, despite 
preceding 'typename' keyword}}
+  //   cxx98-note@#cwg1004-t {{in instantiation of default argument for 
'Third<A<int> >' required here}}
+  //   since-cxx11-note@#cwg1004-t {{in instantiation of default argument for 
'Third<A<int>>' required here}}
   Third<A<int> > t; // #cwg1004-t
 } // namespace cwg1004
 
diff --git a/clang/test/CXX/drs/cwg13xx.cpp b/clang/test/CXX/drs/cwg13xx.cpp
index 0f97c484becdb..29d66ffb9241f 100644
--- a/clang/test/CXX/drs/cwg13xx.cpp
+++ b/clang/test/CXX/drs/cwg13xx.cpp
@@ -79,47 +79,40 @@ namespace cwg1310 { // cwg1310: 5
     W<int>::W<int> w1b;
     // expected-error@-1 {{qualified reference to 'W' is a constructor name 
rather than a template name in this context}}
     W<int>::W<int>::X w1bx;
+#if __cplusplus >= 201103L
     typename W<int>::W w2a;
-    // expected-error@-1 {{ISO C++ specifies that qualified reference to 'W' 
is a constructor name rather than a type in this context, despite preceding 
'typename' keyword}}
-    // cxx98-error@-2 {{'typename' outside of a template is a C++11 extension}}
+    // since-cxx11-error@-1 {{ISO C++ specifies that qualified reference to 
'W' is a constructor name rather than a type in this context, despite preceding 
'typename' keyword}}
     typename W<int>::W::X w2ax;
-    // cxx98-error@-1 {{'typename' outside of a template is a C++11 extension}}
     typename W<int>::W<int> w2b;
-    // expected-error@-1 {{ISO C++ specifies that qualified reference to 'W' 
is a constructor name rather than a template name in this context, despite 
preceding 'typename' keyword}}
-    // cxx98-error@-2 {{'typename' outside of a template is a C++11 extension}}
+    // since-cxx11-error@-1 {{ISO C++ specifies that qualified reference to 
'W' is a constructor name rather than a template name in this context, despite 
preceding 'typename' keyword}}
     typename W<int>::W<int>::X w2bx;
-    // cxx98-error@-1 {{'typename' outside of a template is a C++11 extension}}
     W<int>::template W<int> w3;
-    // expected-error@-1 {{ISO C++ specifies that qualified reference to 'W' 
is a constructor name rather than a template name in this context, despite 
preceding 'template' keyword}}
-    // cxx98-error@-2 {{'template' keyword outside of a template}}
+    // since-cxx11-error@-1 {{ISO C++ specifies that qualified reference to 
'W' is a constructor name rather than a template name in this context, despite 
preceding 'template' keyword}}
     W<int>::template W<int>::X w3x;
-    // cxx98-error@-1 {{'template' keyword outside of a template}}
     typename W<int>::template W<int> w4;
-    // expected-error@-1 {{ISO C++ specifies that qualified reference to 'W' 
is a constructor name rather than a template name in this context, despite 
preceding 'template' keyword}}
-    // cxx98-error@-2 {{'template' keyword outside of a template}}
-    // cxx98-error@-3 {{'typename' outside of a template is a C++11 extension}}
+    // since-cxx11-error@-1 {{ISO C++ specifies that qualified reference to 
'W' is a constructor name rather than a template name in this context, despite 
preceding 'template' keyword}}
     typename W<int>::template W<int>::X w4x;
-    // cxx98-error@-1 {{'template' keyword outside of a template}}
-    // cxx98-error@-2 {{'typename' outside of a template is a C++11 extension}}
+#endif
 
     TT<W<int>::W> tt1;
     // expected-error@-1 {{qualified reference to 'W' is a constructor name 
rather than a type in this context}}
     TTy<W<int>::W> tt1a;
     // expected-error@-1 {{qualified reference to 'W' is a constructor name 
rather than a type in this context}}
-    TT<W<int>::template W> tt2;
-    // expected-error@-1 {{ISO C++ specifies that qualified reference to 'W' 
is a constructor name rather than a template name in this context, despite 
preceding 'template' keyword}}
-    // cxx98-error@-2 {{'template' keyword outside of a template}}
     TT<W<int>::WBase> tt3;
     TTy<W<int>::WBase> tt3a;
+#if __cplusplus >= 201103L
+    TT<W<int>::template W> tt2;
+    // since-cxx11-error@-1 {{ISO C++ specifies that qualified reference to 
'W' is a constructor name rather than a template name in this context, despite 
preceding 'template' keyword}}
     TT<W<int>::template WBase> tt4;
-    // cxx98-error@-1 {{'template' keyword outside of a template}}
+#endif
 
     W<int> w;
     (void)w.W::W::n;
     (void)w.W<int>::W::n;
     (void)w.W<int>::W<int>::n;
+#if __cplusplus >= 201103L
     (void)w.W<int>::template W<int>::n;
-    // cxx98-error@-1 {{'template' keyword outside of a template}}
+#endif
   }
 
   template<typename W>
@@ -260,19 +253,18 @@ namespace cwg1330 { // cwg1330: 4 c++11
   static_assert(!noexcept(B<Q>().g()), "");
 #endif
 
+#if __cplusplus <= 201402L
   template<typename T> int f() throw(typename T::error) { return 0; } // 
#cwg1330-f
-  // expected-error@#cwg1330-f {{type 'int' cannot be used prior to '::' 
because it has no members}}
+  // cxx98-14-error@#cwg1330-f {{type 'int' cannot be used prior to '::' 
because it has no members}}
   //   cxx98-note@#cwg1330-f-int {{in instantiation of function template 
specialization 'cwg1330::f<int>' requested here}}
-  //   since-cxx11-note@#cwg1330-f-int {{in instantiation of exception 
specification for 'f<int>' requested here}}
+  //   cxx11-14-note@#cwg1330-f-int {{in instantiation of exception 
specification for 'f<int>' requested here}}
+  // cxx11-14-error@#cwg1330-f {{type 'char' cannot be used prior to '::' 
because it has no members}}
+  //   cxx11-14-note@#cwg1330-f-char {{in instantiation of exception 
specification for 'f<char>' requested here}}
+  // cxx11-14-error@#cwg1330-f {{type 'float' cannot be used prior to '::' 
because it has no members}}
+  //   cxx11-14-note@#cwg1330-f-float {{in instantiation of exception 
specification for 'f<float>' requested here}}
   // cxx98-14-error@#cwg1330-f {{type 'short' cannot be used prior to '::' 
because it has no members}}
-  //   cxx98-14-note@#cwg1330-f-short {{in instantiation of function template 
specialization 'cwg1330::f<short>' requested here}}
   //   cxx11-14-note@#cwg1330-f {{in instantiation of exception specification 
for 'f<short>' requested here}}
-  // since-cxx11-error@#cwg1330-f {{type 'char' cannot be used prior to '::' 
because it has no members}}
-  //   since-cxx11-note@#cwg1330-f-char {{in instantiation of exception 
specification for 'f<char>' requested here}}
-  // since-cxx11-error@#cwg1330-f {{type 'float' cannot be used prior to '::' 
because it has no members}}
-  //   since-cxx11-note@#cwg1330-f-float {{in instantiation of exception 
specification for 'f<float>' requested here}}
-  // since-cxx17-error@#cwg1330-f {{ISO C++17 does not allow dynamic exception 
specifications}}
-  //   since-cxx17-note@#cwg1330-f {{use 'noexcept(false)' instead}}
+  //   cxx98-14-note@#cwg1330-f-short {{in instantiation of function template 
specialization 'cwg1330::f<short>' requested here}}
 
   // An exception-specification is needed even if the function is only used in
   // an unevaluated operand.
@@ -282,9 +274,7 @@ namespace cwg1330 { // cwg1330: 4 c++11
   bool f3 = noexcept(f<float>()); /// #cwg1330-f-float
 #endif
   template int f<short>(); // #cwg1330-f-short
-  // since-cxx17-error@#cwg1330-f {{type 'short' cannot be used prior to '::' 
because it has no members}}
-  //   since-cxx17-note@#cwg1330-f {{in instantiation of exception 
specification for 'f<short>' requested here}}
-  //   since-cxx17-note@#cwg1330-f-short {{in instantiation of function 
template specialization 'cwg1330::f<short>' requested here}}
+#endif
 
   template<typename T> struct C {
     C() throw(typename T::type); // #cwg1330-C
@@ -358,22 +348,17 @@ namespace cwg1346 { // cwg1346: 3.5
   }
   template void f(); // #cwg1346-f
 
-#if __cplusplus >= 201103L
+#if __cplusplus >= 201402L
   void init_capture() {
     [a(1)] {} ();
-    // cxx11-error@-1 {{initialized lambda captures are a C++14 extension}}
     [b(1, 2)] {} ();
-    // cxx11-error@-1 {{initialized lambda captures are a C++14 extension}}
-    // since-cxx11-error@-2 {{initializer for lambda capture 'b' contains 
multiple expressions}}
+    // since-cxx14-error@-1 {{initializer for lambda capture 'b' contains 
multiple expressions}}
     [c({})] {} ();
-    // cxx11-error@-1 {{initialized lambda captures are a C++14 extension}}
-    // since-cxx11-error@-2 {{cannot deduce type for lambda capture 'c' from 
parenthesized initializer list}}
+    // since-cxx14-error@-1 {{cannot deduce type for lambda capture 'c' from 
parenthesized initializer list}}
     [d({1})] {} ();
-    // cxx11-error@-1 {{initialized lambda captures are a C++14 extension}}
-    // since-cxx11-error@-2 {{cannot deduce type for lambda capture 'd' from 
parenthesized initializer list}}
+    // since-cxx14-error@-1 {{cannot deduce type for lambda capture 'd' from 
parenthesized initializer list}}
     [e({1, 2})] {} ();
-    // cxx11-error@-1 {{initialized lambda captures are a C++14 extension}}
-    // since-cxx11-error@-2 {{cannot deduce type for lambda capture 'e' from 
parenthesized initializer list}}
+    // since-cxx14-error@-1 {{cannot deduce type for lambda capture 'e' from 
parenthesized initializer list}}
   }
 #endif
 } // namespace cwg1346
diff --git a/clang/test/CXX/drs/cwg15xx.cpp b/clang/test/CXX/drs/cwg15xx.cpp
index 8e3e49dc42ce0..e97584c293cc4 100644
--- a/clang/test/CXX/drs/cwg15xx.cpp
+++ b/clang/test/CXX/drs/cwg15xx.cpp
@@ -38,22 +38,40 @@ namespace cwg1512 { // cwg1512: 4
   template<typename A, typename B, typename C> void 
composite_pointer_type_is_ord() {
     composite_pointer_type_is_base<A, B, C>();
 
-    typedef __typeof(val<A>() < val<B>()) cmp; // #cwg1512-lt
-    // since-cxx17-warning@#cwg1512-lt {{ordered comparison of function 
pointers ('int (*)() noexcept' and 'int (*)()')}}
-    //   since-cxx17-note@#cwg1512-noexcept-1st {{in instantiation of function 
template specialization 'cwg1512::composite_pointer_type_is_ord<int (*)() 
noexcept, int (*)(), int (*)()>' requested here}}
-    // since-cxx17-warning@#cwg1512-lt {{ordered comparison of function 
pointers ('int (*)()' and 'int (*)() noexcept')}}
-    //   since-cxx17-note@#cwg1512-noexcept-2nd {{in instantiation of function 
template specialization 'cwg1512::composite_pointer_type_is_ord<int (*)(), int 
(*)() noexcept, int (*)()>' requested here}}
+    typedef __typeof(val<A>() < val<B>()) cmp;
     typedef __typeof(val<A>() <= val<B>()) cmp;
-    // since-cxx17-warning@-1 {{ordered comparison of function pointers ('int 
(*)() noexcept' and 'int (*)()')}}
-    // since-cxx17-warning@-2 {{ordered comparison of function pointers ('int 
(*)()' and 'int (*)() noexcept')}}
     typedef __typeof(val<A>() > val<B>()) cmp;
-    // since-cxx17-warning@-1 {{ordered comparison of function pointers ('int 
(*)() noexcept' and 'int (*)()')}}
-    // since-cxx17-warning@-2 {{ordered comparison of function pointers ('int 
(*)()' and 'int (*)() noexcept')}}
     typedef __typeof(val<A>() >= val<B>()) cmp;
+    typedef bool cmp;
+  }
+
+#if __cplusplus >= 201703L
+  void composite_pointer_type_is_ord_2() {
+    composite_pointer_type_is_base<int (*)() noexcept, int (*)(), int (*)()>();
+
+    typedef __typeof(val<int (*)() noexcept>() < val<int (*)()>()) cmp;
+    // since-cxx17-warning@-1 {{ordered comparison of function pointers ('int 
(*)() noexcept' and 'int (*)()')}}
+    typedef __typeof(val<int (*)() noexcept>() <= val<int (*)()>()) cmp;
+    // since-cxx17-warning@-1 {{ordered comparison of function pointers ('int 
(*)() noexcept' and 'int (*)()')}}
+    typedef __typeof(val<int (*)() noexcept>() > val<int (*)()>()) cmp;
+    // since-cxx17-warning@-1 {{ordered comparison of function pointers ('int 
(*)() noexcept' and 'int (*)()')}}
+    typedef __typeof(val<int (*)() noexcept>() >= val<int (*)()>()) cmp;
     // since-cxx17-warning@-1 {{ordered comparison of function pointers ('int 
(*)() noexcept' and 'int (*)()')}}
-    // since-cxx17-warning@-2 {{ordered comparison of function pointers ('int 
(*)()' and 'int (*)() noexcept')}}
+
+    composite_pointer_type_is_base<int (*)(), int (*)() noexcept, int (*)()>();
+
+    typedef __typeof(val<int (*)()>() < val<int (*)() noexcept>()) cmp;
+    // since-cxx17-warning@-1 {{ordered comparison of function pointers ('int 
(*)()' and 'int (*)() noexcept')}}
+    typedef __typeof(val<int (*)()>() <= val<int (*)() noexcept>()) cmp;
+    // since-cxx17-warning@-1 {{ordered comparison of function pointers ('int 
(*)()' and 'int (*)() noexcept')}}
+    typedef __typeof(val<int (*)()>() > val<int (*)() noexcept>()) cmp;
+    // since-cxx17-warning@-1 {{ordered comparison of function pointers ('int 
(*)()' and 'int (*)() noexcept')}}
+    typedef __typeof(val<int (*)()>() >= val<int (*)() noexcept>()) cmp;
+    // since-cxx17-warning@-1 {{ordered comparison of function pointers ('int 
(*)()' and 'int (*)() noexcept')}}
+
     typedef bool cmp;
   }
+#endif
 
   template <typename A, typename B, typename C>
   void composite_pointer_type_is_unord(int = 0) {
@@ -100,8 +118,6 @@ namespace cwg1512 { // cwg1512: 4
     // since-cxx20-warning@-1 {{volatile-qualified return type 'volatile int' 
is deprecated}}
 
 #if __cplusplus >= 201703L
-    composite_pointer_type_is_ord<int (*)() noexcept, int (*)(), int (*)()>(); 
// #cwg1512-noexcept-1st
-    composite_pointer_type_is_ord<int (*)(), int (*)() noexcept, int (*)()>(); 
// #cwg1512-noexcept-2nd
     composite_pointer_type_is_unord<int (A::*)() noexcept, int (A::*)(), int 
(A::*)()>();
     composite_pointer_type_is_unord<int (A::*)(), int (A::*)() noexcept, int 
(A::*)()>();
     // FIXME: This looks like a standard defect; these should probably all 
have type 'int (B::*)()'.
@@ -157,15 +173,15 @@ namespace cwg1512 { // cwg1512: 4
     //   since-cxx11-note@#cwg1512-Wrap {{first operand was implicitly 
converted to type 'std::nullptr_t'}}
     //   since-cxx11-note@#cwg1512-Wrap {{second operand was implicitly 
converted to type 'int *'}}
     void(Wrap<nullptr_t>() > Wrap<int*>());
-    // since-cxx11-error@-1 {{invalid operands}}
+    // since-cxx11-error@-1 {{invalid operands to binar...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/179813
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to