The following code compiles with GCC 7.3.0 and earlier, but errors with GCC 8.1.0 and trunk. 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(); } <source>: In instantiation of 'struct Outer<int>::Inner': <source>:12:36: required from here <source>:8:28: error: declaration of 'decltype (f<42>()) Outer<T>::Inner::f() [with T = int; decltype (f<42>()) = void]' [-fpermissive] struct Outer<T>::Inner { ^ <source>:4:38: error: changes meaning of 'f' from 'static void Outer<T>::f() [with int I = I; T = int]' [-fpermissive] template <int I> static void f(); ^
Started with r251438 PR c++/81236 - ICE with template-id in generic lambda * semantics.c (finish_id_expression): Remove special dependent case. Avoid some later pieces when dependent. (finish_qualified_id_expr): Do normal BASELINK handling in a template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR. (parsing_default_capturing_generic_lambda_in_template): Remove. * parser.c (cp_parser_postfix_dot_deref_expression): Always give an error for types that will never be complete. * mangle.c (write_expression): Add sanity check. * tree.c (build_qualified_name): Add sanity check. (cp_walk_subtrees): Walk into the class context of a BASELINK. * lambda.c (add_capture): Improve diagnostic for generic lambda capture failure. * call.c (build_new_method_call_1): Print the right constructor name.
Author: jason Date: Tue Jun 5 11:27:12 2018 New Revision: 261196 URL: https://gcc.gnu.org/viewcvs?rev=261196&root=gcc&view=rev Log: 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. Added: trunk/gcc/testsuite/g++.dg/template/qualified-id7.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/semantics.c
Author: jason Date: Tue Jun 5 11:27:15 2018 New Revision: 261197 URL: https://gcc.gnu.org/viewcvs?rev=261197&root=gcc&view=rev Log: 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. Added: branches/gcc-8-branch/gcc/testsuite/g++.dg/template/qualified-id7.C Modified: branches/gcc-8-branch/gcc/cp/ChangeLog branches/gcc-8-branch/gcc/cp/semantics.c
Fixed.
*** Bug 86195 has been marked as a duplicate of this bug. ***