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
915829cc
Commit
915829cc
authored
Mar 29, 2011
by
Jason Merrill
Committed by
Jason Merrill
Mar 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* semantics.c (is_valid_constexpr_fn): Specify input location.
From-SVN: r171660
parent
86c8d1f6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
9 deletions
+16
-9
gcc/cp/ChangeLog
+4
-0
gcc/cp/semantics.c
+4
-4
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.dg/cpp0x/constexpr-diag1.C
+4
-5
No files found.
gcc/cp/ChangeLog
View file @
915829cc
2011-03-29 Jason Merrill <jason@redhat.com>
* semantics.c (is_valid_constexpr_fn): Specify input location.
2011-03-28 Jason Merrill <jason@redhat.com>
2011-03-28 Jason Merrill <jason@redhat.com>
PR c++/48313
PR c++/48313
...
...
gcc/cp/semantics.c
View file @
915829cc
...
@@ -5338,8 +5338,8 @@ is_valid_constexpr_fn (tree fun, bool complain)
...
@@ -5338,8 +5338,8 @@ is_valid_constexpr_fn (tree fun, bool complain)
{
{
ret
=
false
;
ret
=
false
;
if
(
complain
)
if
(
complain
)
error
(
"invalid type for parameter %
q#D of constexpr function"
,
error
(
"invalid type for parameter %
d of constexpr "
parm
);
"function %q+#D"
,
DECL_PARM_INDEX
(
parm
),
fun
);
}
}
if
(
!
DECL_CONSTRUCTOR_P
(
fun
))
if
(
!
DECL_CONSTRUCTOR_P
(
fun
))
...
@@ -5349,7 +5349,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
...
@@ -5349,7 +5349,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
{
{
ret
=
false
;
ret
=
false
;
if
(
complain
)
if
(
complain
)
error
(
"invalid return type %qT of constexpr function %qD"
,
error
(
"invalid return type %qT of constexpr function %q
+
D"
,
rettype
,
fun
);
rettype
,
fun
);
}
}
...
@@ -5359,7 +5359,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
...
@@ -5359,7 +5359,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
{
{
ret
=
false
;
ret
=
false
;
if
(
complain
)
if
(
complain
)
error
(
"enclosing class of %q#D is not a literal type"
,
fun
);
error
(
"enclosing class of %q
+
#D is not a literal type"
,
fun
);
}
}
}
}
...
...
gcc/testsuite/ChangeLog
View file @
915829cc
2011-03-29 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/constexpr-diag1.C: Adjust error locations.
2011-03-29 Janus Weil <janus@gcc.gnu.org>
2011-03-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/48095
PR fortran/48095
...
...
gcc/testsuite/g++.dg/cpp0x/constexpr-diag1.C
View file @
915829cc
// Test that we explain why a template instantiation isn't constexpr
// Test that we explain why a template instantiation isn't constexpr
// { dg-options -std=c++0x }
// { dg-options -std=c++0x }
// { dg-prune-output "not a constexpr function" }
template
<
class
T
>
template
<
class
T
>
struct
A
struct
A
{
{
T
t
;
T
t
;
constexpr
int
f
()
{
return
42
;
}
constexpr
int
f
()
{
return
42
;
}
// { dg-error "enclosing class" }
};
};
struct
B
{
B
();
operator
int
();
};
struct
B
{
B
();
operator
int
();
};
...
@@ -14,8 +13,8 @@ struct B { B(); operator int(); };
...
@@ -14,8 +13,8 @@ struct B { B(); operator int(); };
constexpr
A
<
int
>
ai
=
{
42
};
constexpr
A
<
int
>
ai
=
{
42
};
constexpr
int
i
=
ai
.
f
();
constexpr
int
i
=
ai
.
f
();
constexpr
int
b
=
A
<
B
>
().
f
();
// { dg-error "
enclosing class
" }
constexpr
int
b
=
A
<
B
>
().
f
();
// { dg-error "
not a constexpr function
" }
template
<
class
T
>
template
<
class
T
>
constexpr
int
f
(
T
t
)
{
return
42
;
}
constexpr
int
f
(
T
t
)
{
return
42
;
}
// { dg-error "parameter" }
constexpr
int
x
=
f
(
B
());
// { dg-error "parameter
" }
constexpr
int
x
=
f
(
B
());
// { dg-error "constexpr function
" }
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