File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -452,7 +452,7 @@ Bug Fixes to AST Handling
452452
453453Miscellaneous Bug Fixes
454454^^^^^^^^^^^^^^^^^^^^^^^
455- - Fixed missing diagnostics of ``diagnose_if `` on a constructor template involved in initialization. (#GH160776)
455+ - Fixed missing diagnostics of ``diagnose_if `` on templates involved in initialization. (#GH160776)
456456
457457Miscellaneous Clang Crashes Fixed
458458^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change 1- // RUN: %clang_cc1 %s -verify -fno-builtin -std=c++20
2- // RUN: %clang_cc1 %s -verify -fno-builtin -std=c++20 -fexperimental-new-constant-interpreter
1+ // RUN: %clang_cc1 %s -verify -fno-builtin -std=c++14
2+ // RUN: %clang_cc1 %s -verify -fno-builtin -std=c++20 -verify=expected,cxx20
3+ // RUN: %clang_cc1 %s -verify -fno-builtin -std=c++14 -fexperimental-new-constant-interpreter
4+ // RUN: %clang_cc1 %s -verify -fno-builtin -std=c++20 -verify=expected,cxx20 -fexperimental-new-constant-interpreter
35
46#define _diagnose_if (...) __attribute__((diagnose_if(__VA_ARGS__)))
57
@@ -673,17 +675,20 @@ struct ConstructorTemplate {
673675 explicit ConstructorTemplate (T x)
674676 _diagnose_if(sizeof (T) == sizeof(char ), "oh no", "error") {} // expected-note {{diagnose_if}}
675677
676- template <class T > requires (sizeof (T) == 1) // expected-note {{evaluated to false}}
678+ template <class T >
679+ #if __cplusplus >= 202002L
680+ requires (sizeof (T) == 1) // cxx20-note {{evaluated to false}}
681+ #endif
677682 operator T () _diagnose_if(sizeof (T) == sizeof(char ), "oh no", "error") { // expected-note {{diagnose_if}} \
678- // expected -note {{constraints not satisfied}}
683+ // cxx20 -note {{constraints not satisfied}}
679684 return T{};
680685 }
681686};
682687
683688void run () {
684689 ConstructorTemplate x (' 1' ); // expected-error {{oh no}}
685690 char y = x; // expected-error {{oh no}}
686- int z = x; // expected -error {{no viable conversion}}
691+ int z = x; // cxx20 -error {{no viable conversion}}
687692}
688693
689694}
You can’t perform that action at this time.
0 commit comments