Bug 85587 - [8/9 Regression] bogus error: ‘F’ was not declared in this scope
Summary: [8/9 Regression] bogus error: ‘F’ was not declared in this scope
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 8.0
: P1 normal
Target Milestone: 8.0
Assignee: Jason Merrill
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2018-05-01 14:39 UTC by Marek Polacek
Modified: 2018-05-04 20:17 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-05-01 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Polacek 2018-05-01 14:39:32 UTC
template <int N>
struct S
{
  enum class T
  {
    E, F
  };
  void foo ();
};

template <int N>
void S<N>::foo ()
{
  decltype (T::F) t;
}

void
bar ()
{
  S<0> s;
  s.foo ();
}

is rejected since r251438.
Comment 1 Jason Merrill 2018-05-01 18:12:25 UTC
Author: jason
Date: Tue May  1 18:11:53 2018
New Revision: 259805

URL: https://gcc.gnu.org/viewcvs?rev=259805&root=gcc&view=rev
Log:
	PR c++/85587 - error with scoped enum in template.

	* semantics.c (finish_qualified_id_expr): Don't return an
	unqualified IDENTIFIER_NODE.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/scoped_enum8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
Comment 2 Jakub Jelinek 2018-05-02 07:50:59 UTC
Author: jakub
Date: Wed May  2 07:50:28 2018
New Revision: 259824

URL: https://gcc.gnu.org/viewcvs?rev=259824&root=gcc&view=rev
Log:
	PR c++/85587 - error with scoped enum in template.
	* semantics.c (finish_qualified_id_expr): Don't return an
	unqualified IDENTIFIER_NODE.

Added:
    branches/gcc-8-branch/gcc/testsuite/g++.dg/cpp0x/scoped_enum8.C
Modified:
    branches/gcc-8-branch/gcc/cp/ChangeLog
    branches/gcc-8-branch/gcc/cp/semantics.c
Comment 3 Jakub Jelinek 2018-05-02 10:11:52 UTC
GCC 8.1 has been released.
Comment 4 Jason Merrill 2018-05-04 20:17:34 UTC
Fixed in 8.1.