Changeset View
Changeset View
Standalone View
Standalone View
clang/test/CXX/drs/dr26xx.cpp
Show All 28 Lines | |||||
} | } | ||||
namespace dr2635 { // dr2635: 16 | namespace dr2635 { // dr2635: 16 | ||||
template<typename T> | template<typename T> | ||||
concept UnaryC = true; | concept UnaryC = true; | ||||
template<typename T, typename U> | template<typename T, typename U> | ||||
concept BinaryC = true; | concept BinaryC = true; | ||||
aaron.ballman: Should you add:
```
#define z(x) 0
#define a z(
int x = a\N{abc});
```
from the issue as… | |||||
struct S{ int i, j; }; | struct S{ int i, j; }; | ||||
S get_S(); | S get_S(); | ||||
template<typename T> | template<typename T> | ||||
Not Done ReplyInline ActionsWhy do we get two errors here? Also, can you add this case: int y = a\N{LOTUS}); to show that we now form an identifier for a\N{LOTUS} instead of trying to expand a as a macro; we should get a new diagnostic about the stray ) instead. aaron.ballman: Why do we get two errors here?
Also, can you add this case:
```
int y = a\N{LOTUS});
```
to… | |||||
I did manage to improve that a bit, took a while. cor3ntin: I did manage to improve that a bit, took a while.
The tradeoff is slightly subpar recovery in… | |||||
T get_T(); | T get_T(); | ||||
void use() { | void use() { | ||||
// expected-error@+1{{decomposition declaration cannot be declared with constrained 'auto'}} | // expected-error@+1{{decomposition declaration cannot be declared with constrained 'auto'}} | ||||
UnaryC auto [a, b] = get_S(); | UnaryC auto [a, b] = get_S(); | ||||
// expected-error@+1{{decomposition declaration cannot be declared with constrained 'auto'}} | // expected-error@+1{{decomposition declaration cannot be declared with constrained 'auto'}} | ||||
BinaryC<int> auto [c, d] = get_S(); | BinaryC<int> auto [c, d] = get_S(); | ||||
} | } | ||||
template<typename T> | template<typename T> | ||||
void TemplUse() { | void TemplUse() { | ||||
// expected-error@+1{{decomposition declaration cannot be declared with constrained 'auto'}} | // expected-error@+1{{decomposition declaration cannot be declared with constrained 'auto'}} | ||||
UnaryC auto [a, b] = get_T<T>(); | UnaryC auto [a, b] = get_T<T>(); | ||||
// expected-error@+1{{decomposition declaration cannot be declared with constrained 'auto'}} | // expected-error@+1{{decomposition declaration cannot be declared with constrained 'auto'}} | ||||
BinaryC<T> auto [c, d] = get_T<T>(); | BinaryC<T> auto [c, d] = get_T<T>(); | ||||
} | } | ||||
} | } | ||||
// dr2636: na | // dr2636: na | ||||
namespace dr2640 { // dr2640: 16 | |||||
int \N{Λ} = 0; //expected-error {{'Λ' is not a valid Unicode character name}} \ | |||||
//expected-error {{expected unqualified-id}} | |||||
const char* emoji = "\N{🤡}"; // expected-error {{'🤡' is not a valid Unicode character name}} \ | |||||
// expected-note 5{{did you mean}} | |||||
#define z(x) 0 | |||||
#define dr2640_a z( | |||||
int x = dr2640_a\N{abc}); // expected-error {{'abc' is not a valid Unicode character name}} | |||||
int y = dr2640_a\N{LOTUS}); // expected-error {{character <U+1FAB7> not allowed in an identifier}} \ | |||||
// expected-error {{use of undeclared identifier 'dr2640_a🪷'}} \ | |||||
// expected-error {{extraneous ')' before ';'}} | |||||
} | |||||
// dr2642: na | // dr2642: na | ||||
namespace dr2644 { // dr2644: yes | namespace dr2644 { // dr2644: yes | ||||
auto z = [a = 42](int a) { // expected-error {{a lambda parameter cannot shadow an explicitly captured entity}} \ | auto z = [a = 42](int a) { // expected-error {{a lambda parameter cannot shadow an explicitly captured entity}} \ | ||||
// expected-note {{variable 'a' is explicitly captured here}} | // expected-note {{variable 'a' is explicitly captured here}} | ||||
return 1; | return 1; | ||||
}; | }; | ||||
Show All 21 Lines |
Should you add:
from the issue as a test case as well?