PR c++/85731 - wrong error with qualified-id in template.

* semantics.c (finish_qualified_id_expr): build_qualified_name
	for unbound names in the current class.

From-SVN: r261196
This commit is contained in:
Jason Merrill 2018-06-05 07:27:12 -04:00 committed by Jason Merrill
parent b401e50fed
commit 066c4268db
3 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2018-06-05 Jason Merrill <jason@redhat.com>
PR c++/85731 - wrong error with qualified-id in template.
* semantics.c (finish_qualified_id_expr): build_qualified_name
for unbound names in the current class.
2018-06-04 Jason Merrill <jason@redhat.com>
PR c++/61806 - missed SFINAE with partial specialization.

View File

@ -2098,6 +2098,8 @@ finish_qualified_id_expr (tree qualifying_class,
non-type template argument handling. */
if (processing_template_decl
&& (!currently_open_class (qualifying_class)
|| TREE_CODE (expr) == IDENTIFIER_NODE
|| TREE_CODE (expr) == TEMPLATE_ID_EXPR
|| TREE_CODE (expr) == BIT_NOT_EXPR))
expr = build_qualified_name (TREE_TYPE (expr),
qualifying_class, expr,

View File

@ -0,0 +1,15 @@
// PR c++/85731
// { dg-do compile { target c++11 } }
template <typename T>
struct Outer {
struct Inner;
template <int I> static void f();
};
template <typename T>
struct Outer<T>::Inner {
decltype(Outer<T>::f<42>()) f();
};
int main() { Outer<int>::Inner().f(); }