This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C/C++ PATCH to allow deprecating enum values (PR c/47043)

On Wed, May 06, 2015 at 11:17:20PM -0400, Ed Smith-Rowland wrote:
> In addition to a PR this is 1/2 of a C=+17 feature. (The other half - really
> a separate thing - is attributes on namespaces).

Ah, nice, I wasn't aware.  For the record, this is
> I wonder if we should pedwarn for < C++17?
> Or it could be just an extension for < C++17 - I guess that would match with
> clang.
Yeah, it is meant as a GNU extension.  (clang supports this extension for
several years already.)  I'd rather let Jason decide what to do wrt C++17.
> @@ -3651,11 +3651,6 @@ finish_id_expression (tree id_expression,
>      }
>      }
> -  /* Handle references (c++/56130).  */
> -  tree t = REFERENCE_REF_P (decl) ? TREE_OPERAND (decl, 0) : decl;
> -  if (TREE_DEPRECATED (t))
> -    warn_deprecated_use (t, NULL_TREE);
> -
>    return decl;
>  }
> Why did this bit get removed?

This hunk got added in r201906 to address c++/56130 - we didn't warn for
deprecated references:

int g_nn;
int& g_n __attribute__((deprecated)) = g_nn;

int main()
    g_n = 1;

But then Jason added warn_deprecated_use to mark_used in r217677 and we
warned twice.  So I figured the warning in finish_id_expression isn't
needed anymore.
> Do we handle enums in template specializations?

Not sure, could you provide a testcase?  Thanks,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]