aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2016-01-19 14:02:40 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2016-01-19 14:02:40 +0000
commit1e2970064a996338c20f55b4b900ac678d0ceb94 (patch)
treedecf75e7e87bfbaae21783d477ba29dfa48b91bb /gcc/cp/decl.c
parentc8012fbce973bebc5cf2a9905ebfa9fbaec1afa0 (diff)
downloadgcc-1e2970064a996338c20f55b4b900ac678d0ceb94.zip
gcc-1e2970064a996338c20f55b4b900ac678d0ceb94.tar.gz
gcc-1e2970064a996338c20f55b4b900ac678d0ceb94.tar.bz2
re PR c++/68586 (Enum template parameter wrongly rejected)
PR c++/68586 * constexpr.c (clear_cv_cache): New. * cp-gimplify.c (clear_fold_cache): New. * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare. * decl.c (finish_enum_value_list): Call them. * g++.dg/cpp0x/enum30.C: New test. From-SVN: r232562
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 187390d..ceeef60 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13392,6 +13392,11 @@ finish_enum_value_list (tree enumtype)
/* Finish debugging output for this type. */
rest_of_type_compilation (enumtype, namespace_bindings_p ());
+
+ /* Each enumerator now has the type of its enumeration. Clear the cache
+ so that this change in types doesn't confuse us later on. */
+ clear_cv_cache ();
+ clear_fold_cache ();
}
/* Finishes the enum type. This is called only the first time an