Skip to content

Commit c0ff5ac

Browse files
committed
Require a _qualified-id_ for non-namespace using
1 parent 6eb362e commit c0ff5ac

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

regression-tests/test-results/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
cppfront compiler v0.3.0 Build 9104:1031
2+
cppfront compiler v0.3.0 Build 9104:1043
33
Copyright(c) Herb Sutter All rights reserved
44

55
SPDX-License-Identifier: CC-BY-NC-ND-4.0

source/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"9104:1031"
1+
"9104:1043"

source/parse.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7232,7 +7232,7 @@ class parser
72327232

72337233

72347234
//G using-statement:
7235-
//G 'using' id-expression ';'
7235+
//G 'using' qualified-id ';'
72367236
//G 'using' 'namespace' id-expression ';'
72377237
//G
72387238
auto using_statement()
@@ -7256,6 +7256,10 @@ class parser
72567256
error(std::string{"expected valid id-expression after 'using"} + (n->for_namespace ? " namespace" : "") + "'");
72577257
return {};
72587258
}
7259+
if (!n->for_namespace && !id->is_qualified()) {
7260+
error("'using' for a specific name (not 'using namespace') must specify a qualified name", false);
7261+
return {};
7262+
}
72597263

72607264
n->id = std::move(id);
72617265

0 commit comments

Comments
 (0)