Skip to content

Commit bbddedb

Browse files
authored
Fixed grammatical error in "enum specifier" error msg #94443 (#94592)
As discussed in #94443, this PR changes the wording to be more correct.
1 parent 374f655 commit bbddedb

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6088,9 +6088,9 @@ def err_redefinition_different_concept : Error<
60886088
"redefinition of concept %0 with different template parameters or requirements">;
60896089
def err_tag_reference_non_tag : Error<
60906090
"%select{non-struct type|non-class type|non-union type|non-enum "
6091-
"type|typedef|type alias|template|type alias template|template "
6092-
"template argument}1 %0 cannot be referenced with a "
6093-
"%select{struct|interface|union|class|enum}2 specifier">;
6091+
"type|typedef|type alias|template|alias template|template "
6092+
"template argument}1 %0 cannot be referenced with the '"
6093+
"%select{struct|interface|union|class|enum}2' specifier">;
60946094
def err_tag_reference_conflict : Error<
60956095
"implicit declaration introduced by elaborated type conflicts with a "
60966096
"%select{non-struct type|non-class type|non-union type|non-enum "

clang/test/CXX/basic/basic.lookup/basic.lookup.elab/p2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace test0 {
99
typedef int A; // expected-note {{declared here}}
1010

1111
int test() {
12-
struct A a; // expected-error {{typedef 'A' cannot be referenced with a struct specifier}}
12+
struct A a; // expected-error {{typedef 'A' cannot be referenced with the 'struct' specifier}}
1313
return a.foo;
1414
}
1515
}
@@ -18,7 +18,7 @@ namespace test0 {
1818
template <class> class A; // expected-note {{declared here}}
1919

2020
int test() {
21-
struct A a; // expected-error {{template 'A' cannot be referenced with a struct specifier}}
21+
struct A a; // expected-error {{template 'A' cannot be referenced with the 'struct' specifier}}
2222
return a.foo;
2323
}
2424
}

clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p2-0x.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
struct A { typedef int type; };
44
template<typename T> using X = A; // expected-note {{declared here}}
5-
struct X<int>* p2; // expected-error {{type alias template 'X' cannot be referenced with a struct specifier}}
5+
struct X<int>* p2; // expected-error {{alias template 'X' cannot be referenced with the 'struct' specifier}}
66

77

88
template<typename T> using Id = T; // expected-note {{declared here}}
99
template<template<typename> class F>
1010
struct Y {
11-
struct F<int> i; // expected-error {{type alias template 'Id' cannot be referenced with a struct specifier}}
11+
struct F<int> i; // expected-error {{alias template 'Id' cannot be referenced with the 'struct' specifier}}
1212
typename F<A>::type j; // ok
1313

1414
// FIXME: don't produce the diagnostic both for the definition and the instantiation.
1515
template<typename T> using U = F<char>; // expected-note 2{{declared here}}
16-
struct Y<F>::template U<char> k; // expected-error 2{{type alias template 'U' cannot be referenced with a struct specifier}}
16+
struct Y<F>::template U<char> k; // expected-error 2{{alias template 'U' cannot be referenced with the 'struct' specifier}}
1717
typename Y<F>::template U<char> l; // ok
1818
};
1919
template struct Y<Id>; // expected-note {{requested here}}

clang/test/CXX/drs/cwg2xx.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ namespace cwg254 { // cwg254: 2.9
759759
typedef typename T::type type; // ok even if this is a typedef-name, because
760760
// it's not an elaborated-type-specifier
761761
typedef struct T::type foo;
762-
// expected-error@-1 {{typedef 'type' cannot be referenced with a struct specifier}}
762+
// expected-error@-1 {{typedef 'type' cannot be referenced with the 'struct' specifier}}
763763
// expected-note@#cwg254-instantiation {{in instantiation of template class 'cwg254::A<cwg254::C>' requested here}}
764764
// expected-note@#cwg254-C {{declared here}}
765765
};
@@ -1264,10 +1264,10 @@ namespace cwg298 { // cwg298: 3.1
12641264

12651265
struct A a;
12661266
struct B b;
1267-
// expected-error@-1 {{typedef 'B' cannot be referenced with a struct specifier}}
1267+
// expected-error@-1 {{typedef 'B' cannot be referenced with the 'struct' specifier}}
12681268
// expected-note@#cwg298-B {{declared here}}
12691269
struct C c;
1270-
// expected-error@-1 {{typedef 'C' cannot be referenced with a struct specifier}}
1270+
// expected-error@-1 {{typedef 'C' cannot be referenced with the 'struct' specifier}}
12711271
// expected-note@#cwg298-C {{declared here}}
12721272

12731273
B::B() {}

clang/test/CXX/drs/cwg4xx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ namespace cwg407 { // cwg407: 3.8
170170
{
171171
typedef struct S S; // #cwg407-typedef-S
172172
struct S *p;
173-
// expected-error@-1 {{typedef 'S' cannot be referenced with a struct specifier}}
173+
// expected-error@-1 {{typedef 'S' cannot be referenced with the 'struct' specifier}}
174174
// expected-note@#cwg407-typedef-S {{declared here}}
175175
}
176176
}

clang/test/CXX/temp/temp.decls/temp.friend/p1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ namespace test7 {
174174

175175
// This shouldn't crash.
176176
template <class T> class D {
177-
friend class A; // expected-error {{template 'A' cannot be referenced with a class specifier}}
177+
friend class A; // expected-error {{template 'A' cannot be referenced with the 'class' specifier}}
178178
};
179179
template class D<int>;
180180
}

clang/test/CXX/temp/temp.spec/no-body.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace good { // Only good in C++98/03
4343

4444
namespace unsupported {
4545
#ifndef FIXING
46-
template struct y; // expected-error {{template 'y' cannot be referenced with a struct specifier}}
46+
template struct y; // expected-error {{template 'y' cannot be referenced with the 'struct' specifier}}
4747
#endif
4848
}
4949

clang/test/SemaCXX/PR8755.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct A {
77

88
template <typename T>
99
void f() {
10-
class A <T> ::iterator foo; // expected-error{{typedef 'iterator' cannot be referenced with a class specifier}}
10+
class A <T> ::iterator foo; // expected-error{{typedef 'iterator' cannot be referenced with the 'class' specifier}}
1111
}
1212

1313
void g() {

clang/test/SemaCXX/using-decl-templates.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ namespace aliastemplateinst {
9090
template<typename T> struct A { };
9191
template<typename T> using APtr = A<T*>; // expected-note{{previous use is here}}
9292

93-
template struct APtr<int>; // expected-error{{type alias template 'APtr' cannot be referenced with a struct specifier}}
93+
template struct APtr<int>; // expected-error{{alias template 'APtr' cannot be referenced with the 'struct' specifier}}
9494
}
9595

9696
namespace DontDiagnoseInvalidTest {

clang/test/SemaTemplate/template-id-expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ template <template <typename> class D>
179179
class E {
180180
template class D<C>; // expected-error {{expected '<' after 'template'}}
181181
template<> class D<C>; // expected-error {{cannot specialize a template template parameter}}
182-
friend class D<C>; // expected-error {{type alias template 'D' cannot be referenced with a class specifier}}
182+
friend class D<C>; // expected-error {{alias template 'D' cannot be referenced with the 'class' specifier}}
183183
};
184184
#if __cplusplus <= 199711L
185185
// expected-warning@+2 {{extension}}

0 commit comments

Comments
 (0)