]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cp/decl.c
c++: extern thread_local declarations in constexpr [PR104994]
[thirdparty/gcc.git] / gcc / cp / decl.c
index 15190d858058158add995bd85848b417609393c4..565f5711fd50ba33618df108e423e4ebe44f933a 100644 (file)
@@ -5267,7 +5267,7 @@ start_decl (const cp_declarator *declarator,
       && DECL_DECLARED_CONSTEXPR_P (current_function_decl))
     {
       bool ok = false;
-      if (CP_DECL_THREAD_LOCAL_P (decl))
+      if (CP_DECL_THREAD_LOCAL_P (decl) && !DECL_REALLY_EXTERN (decl))
        error_at (DECL_SOURCE_LOCATION (decl),
                  "%qD declared %<thread_local%> in %<constexpr%> function",
                  decl);