Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
9635923d
Commit
9635923d
authored
May 24, 2018
by
Ville Voutilainen
Committed by
Ville Voutilainen
May 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pedwarn on a non-standard position of a C++ attribute.
From-SVN: r260682
parent
fd657f1a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
2 deletions
+20
-2
gcc/cp/ChangeLog
+6
-0
gcc/cp/parser.c
+5
-0
gcc/testsuite/g++.dg/cpp0x/gen-attrs-56.C
+1
-1
gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C
+1
-1
gcc/testsuite/g++.dg/cpp1z/namespace-attribs2.C
+7
-0
No files found.
gcc/cp/ChangeLog
View file @
9635923d
2018-05-24 Ville Voutilainen <ville.voutilainen@gmail.com>
Pedwarn on a non-standard position of a C++ attribute.
* parser.c (cp_parser_namespace_definition): Pedwarn about attributes
after the namespace name.
2018-05-24 Paolo Carlini <paolo.carlini@oracle.com>
2018-05-24 Paolo Carlini <paolo.carlini@oracle.com>
* cp-tree.h (INDIRECT_TYPE_P): New.
* cp-tree.h (INDIRECT_TYPE_P): New.
...
...
gcc/cp/parser.c
View file @
9635923d
...
@@ -18656,6 +18656,11 @@ cp_parser_namespace_definition (cp_parser* parser)
...
@@ -18656,6 +18656,11 @@ cp_parser_namespace_definition (cp_parser* parser)
{
{
identifier
=
cp_parser_identifier
(
parser
);
identifier
=
cp_parser_identifier
(
parser
);
if
(
cp_next_tokens_can_be_std_attribute_p
(
parser
))
pedwarn
(
input_location
,
OPT_Wpedantic
,
"standard attributes on namespaces must precede "
"the namespace name"
);
/* Parse any attributes specified after the identifier. */
/* Parse any attributes specified after the identifier. */
attribs
=
attr_chainon
(
attribs
,
cp_parser_attributes_opt
(
parser
));
attribs
=
attr_chainon
(
attribs
,
cp_parser_attributes_opt
(
parser
));
}
}
gcc/testsuite/g++.dg/cpp0x/gen-attrs-56.C
View file @
9635923d
...
@@ -2,4 +2,4 @@
...
@@ -2,4 +2,4 @@
// { dg-do compile { target c++11 } }
// { dg-do compile { target c++11 } }
namespace
foo
__attribute__
((
visibility
(
"default"
)))
{}
namespace
foo
__attribute__
((
visibility
(
"default"
)))
{}
namespace
bar
[[
gnu
::
visibility
(
"default"
)]]
{}
namespace
[[
gnu
::
visibility
(
"default"
)]]
bar
{}
gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C
View file @
9635923d
// PR c++/85140
// PR c++/85140
// { dg-do compile { target c++11 } }
// { dg-do compile { target c++11 } }
namespace
N
alignas
()
{}
// { dg-error "expected" }
namespace
alignas
()
N
{}
// { dg-error "expected" }
gcc/testsuite/g++.dg/cpp1z/namespace-attribs2.C
0 → 100644
View file @
9635923d
// { dg-options "-std=c++17" }
// { dg-additional-options "-pedantic" }
namespace
B
[[
deprecated
]]
{}
// { dg-warning "ignored|must precede" }
namespace
[[
deprecated
]]
D
{}
// { dg-warning "ignored" }
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment