File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -132,17 +132,20 @@ class CharBlock {
132
132
// "memcmp" in glibc has "nonnull" attributes on the input pointers.
133
133
// Avoid passing null pointers, since it would result in an undefined
134
134
// behavior.
135
- if (size () == 0 )
135
+ if (size () == 0 ) {
136
136
return that.size () == 0 ? 0 : -1 ;
137
- if (that.size () == 0 )
137
+ } else if (that.size () == 0 ) {
138
138
return 1 ;
139
- std::size_t bytes{std::min (size (), that.size ())};
140
- int cmp{std::memcmp (static_cast <const void *>(begin ()),
141
- static_cast <const void *>(that.begin ()), bytes)};
142
- if (cmp != 0 ) {
143
- return cmp;
139
+ } else {
140
+ std::size_t bytes{std::min (size (), that.size ())};
141
+ int cmp{std::memcmp (static_cast <const void *>(begin ()),
142
+ static_cast <const void *>(that.begin ()), bytes)};
143
+ if (cmp != 0 ) {
144
+ return cmp;
145
+ } else {
146
+ return size () < that.size () ? -1 : size () > that.size ();
147
+ }
144
148
}
145
- return size () < that.size () ? -1 : size () > that.size ();
146
149
}
147
150
148
151
int Compare (const char *that) const {
Original file line number Diff line number Diff line change @@ -2253,7 +2253,7 @@ void ScopeHandler::SayWithDecl(
2253
2253
const parser::Name &name, Symbol &symbol, MessageFixedText &&msg) {
2254
2254
bool isFatal{msg.IsFatal ()};
2255
2255
Say (name, std::move (msg), symbol.name ())
2256
- .Attach (Message{name. source ,
2256
+ .Attach (Message{symbol. name () ,
2257
2257
symbol.test (Symbol::Flag::Implicit)
2258
2258
? " Implicit declaration of '%s'" _en_US
2259
2259
: " Declaration of '%s'" _en_US,
@@ -7843,7 +7843,7 @@ const parser::Name *DeclarationVisitor::FindComponent(
7843
7843
auto &symbol{base->symbol ->GetUltimate ()};
7844
7844
if (!symbol.has <AssocEntityDetails>() && !ConvertToObjectEntity (symbol)) {
7845
7845
SayWithDecl (*base, symbol,
7846
- " '%s' is an invalid base for a component reference" _err_en_US);
7846
+ " '%s' is not an object and may not be used as the base of a component reference or type parameter inquiry " _err_en_US);
7847
7847
return nullptr ;
7848
7848
}
7849
7849
auto *type{symbol.GetType ()};
Original file line number Diff line number Diff line change @@ -16,15 +16,15 @@ subroutine s1
16
16
external :: w
17
17
! ERROR: 'z' is not an object of derived type; it is implicitly typed
18
18
i = z% i
19
- ! ERROR: 's1' is an invalid base for a component reference
19
+ ! ERROR: 's1' is not an object and may not be used as the base of a component reference or type parameter inquiry
20
20
i = s1% i
21
21
! ERROR: 'j' is not an object of derived type
22
22
i = j% i
23
23
! ERROR: Component 'j' not found in derived type 't'
24
24
i = x% j
25
- ! ERROR: 'v' is an invalid base for a component reference
25
+ ! ERROR: 'v' is not an object and may not be used as the base of a component reference or type parameter inquiry
26
26
i = v% i
27
- ! ERROR: 'w' is an invalid base for a component reference
27
+ ! ERROR: 'w' is not an object and may not be used as the base of a component reference or type parameter inquiry
28
28
i = w% i
29
29
i = x% i ! OK
30
30
end subroutine
You can’t perform that action at this time.
0 commit comments