g++.dg/modules/lambda-6_a.C. */
if (DECL_IMPLICIT_TYPEDEF_P (STRIP_TEMPLATE (decl))
&& LAMBDA_TYPE_P (TREE_TYPE (decl)))
- if (tree scope = LAMBDA_TYPE_EXTRA_SCOPE (TREE_TYPE (decl)))
- {
- /* Lambdas attached to fields are keyed to its class. */
- if (TREE_CODE (scope) == FIELD_DECL)
- scope = TYPE_NAME (DECL_CONTEXT (scope));
- if (DECL_LANG_SPECIFIC (scope)
- && DECL_MODULE_KEYED_DECLS_P (scope))
- {
- mk = MK_keyed;
- break;
- }
- }
+ {
+ if (tree scope = LAMBDA_TYPE_EXTRA_SCOPE (TREE_TYPE (decl)))
+ {
+ /* Lambdas attached to fields are keyed to its class. */
+ if (TREE_CODE (scope) == FIELD_DECL)
+ scope = TYPE_NAME (DECL_CONTEXT (scope));
+ if (DECL_LANG_SPECIFIC (scope)
+ && DECL_MODULE_KEYED_DECLS_P (scope))
+ {
+ mk = MK_keyed;
+ break;
+ }
+ }
+ /* Lambdas not attached to any mangling scope are TU-local. */
+ mk = MK_unique;
+ break;
+ }
if (TREE_CODE (decl) == TEMPLATE_DECL
&& DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P (decl))
--- /dev/null
+// PR c++/116568
+
+template <typename> struct S {
+ template <typename> using t = decltype([]{});
+};
+
+// 't' does not currently have a mangling scope, but should not ICE
+using t = S<int>::t<int>;