* c++: Adding exception specs can changed dependentness
@ 2020-10-07 12:01 Nathan Sidwell
0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2020-10-07 12:01 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 445 bytes --]
Making an exception variant can cause a non-dependent function type to
become dependent (since c++17 eh-specs are part of the type). The
same is (possibly?) true for adding a late return type. Fixed thusly.
My upcoming local extern-decl changes have a test case that covers
this (which was how I found it).
gcc/cp/
* tree.c (build_cp_fntype_variant): Clear
TYPE_DEPENDENT_P_VALID if necessary.
nathan
--
Nathan Sidwell
[-- Attachment #2: dep-spec.diff --]
[-- Type: text/x-patch, Size: 513 bytes --]
diff --git i/gcc/cp/tree.c w/gcc/cp/tree.c
index 8b7c6798ee9..074fa0c025e 100644
--- i/gcc/cp/tree.c
+++ w/gcc/cp/tree.c
@@ -2638,6 +2638,9 @@ build_cp_fntype_variant (tree type, cp_ref_qualifier rqual,
/* Need to build a new variant. */
v = build_variant_type_copy (type);
+ if (!TYPE_DEPENDENT_P (v))
+ /* We no longer know that it's not type-dependent. */
+ TYPE_DEPENDENT_P_VALID (v) = false;
TYPE_RAISES_EXCEPTIONS (v) = raises;
TYPE_HAS_LATE_RETURN_TYPE (v) = late;
switch (rqual)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-07 12:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 12:01 c++: Adding exception specs can changed dependentness Nathan Sidwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).