File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -1934,7 +1934,7 @@ struct declaration_node
1934
1934
;
1935
1935
}
1936
1936
1937
- auto is_wildcard () const
1937
+ auto has_wildcard_type () const
1938
1938
-> bool
1939
1939
{
1940
1940
return
@@ -5488,6 +5488,14 @@ class parser
5488
5488
// First see if it's an alias declaration
5489
5489
n = alias ();
5490
5490
if (n) {
5491
+ if (is_parameter) {
5492
+ errors.emplace_back (
5493
+ curr ().position (),
5494
+ " a parameter declaration may not be an alias declaration"
5495
+ );
5496
+ return {};
5497
+ }
5498
+
5491
5499
n->pos = start_pos;
5492
5500
n->identifier = std::move (id);
5493
5501
n->access = access ;
@@ -5513,6 +5521,20 @@ class parser
5513
5521
5514
5522
// Note: Do this after trying to parse this as a declaration, for parse backtracking
5515
5523
5524
+ if (
5525
+ !is_parameter
5526
+ && n->is_object ()
5527
+ && n->has_wildcard_type ()
5528
+ && n->parent_is_namespace ()
5529
+ )
5530
+ {
5531
+ errors.emplace_back (
5532
+ n->identifier ->position (),
5533
+ " namespace scope objects must have a concrete type, not a deduced type"
5534
+ );
5535
+ return {};
5536
+ }
5537
+
5516
5538
if (
5517
5539
n->has_name (" _" )
5518
5540
&& !n->is_object ()
You can’t perform that action at this time.
0 commit comments