aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2020-05-28 00:35:56 -0400
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:09:16 -0300
commit4b2fc5f7fc3593f5526a12b25cd0437f41fc047f (patch)
treebf52e824675852b73e40b7e399cf0e997ec337f0 /gcc/cp/constexpr.c
parent5ea3be234859958e9199279b86af2accbd81fb26 (diff)
downloadgcc-4b2fc5f7fc3593f5526a12b25cd0437f41fc047f.zip
gcc-4b2fc5f7fc3593f5526a12b25cd0437f41fc047f.tar.gz
gcc-4b2fc5f7fc3593f5526a12b25cd0437f41fc047f.tar.bz2
c++: Immediately deduce auto member [PR94926].
In r9-297 I was trying to be more flexible and treat static data members of class templates more like variable templates, where the type need not be determined until the variable is instantiated, but I suppose that in a class the types of all the non-template members need to be determined at the time of class instantiation. gcc/cp/ChangeLog: PR c++/94926 * decl.c (cp_finish_decl): Revert r9-297 change. (check_static_variable_definition): Likewise. * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise. * pt.c (instantiate_decl): Return early on type error. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/pr86648.C: Expect error. * g++.dg/cpp1z/static2.C: Expect error. * g++.dg/cpp0x/nsdmi16.C: New test.
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r--gcc/cp/constexpr.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 4e441ac..4b1f92f 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -96,8 +96,6 @@ ensure_literal_type_for_constexpr_object (tree decl)
if (CLASS_TYPE_P (stype) && !COMPLETE_TYPE_P (complete_type (stype)))
/* Don't complain here, we'll complain about incompleteness
when we try to initialize the variable. */;
- else if (type_uses_auto (type))
- /* We don't know the actual type yet. */;
else if (!literal_type_p (type))
{
if (DECL_DECLARED_CONSTEXPR_P (decl))