]> granicus.if.org Git - clang/commitdiff
Add comment to r363191 code as requested in code review
authorReid Kleckner <rnk@google.com>
Wed, 12 Jun 2019 19:50:06 +0000 (19:50 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 12 Jun 2019 19:50:06 +0000 (19:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363195 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp

index d696d262c73defeb78278d9b81a7c0bbc2b7355a..0657528dc1ba466f297aaabd7bf7540d90607f5c 100644 (file)
@@ -9804,8 +9804,11 @@ static GVALinkage basicGVALinkageForVariable(const ASTContext &Context,
       // was marked inline. MSVC 14.21.27702 headers define _Is_integral in a
       // header this way, and we don't want to emit non-discardable definitions
       // of these variables in every TU that includes <type_traits>. This
-      // behavior can be removed if the headers change to explicitly mark such
-      // variable template specializations inline.
+      // behavior is non-conforming, since another TU could use an extern
+      // template declaration for this variable, but for constexpr variables,
+      // it's unlikely for a user to want to do that. This behavior can be
+      // removed if the headers change to explicitly mark such variable template
+      // specializations inline.
       if (isa<VarTemplateSpecializationDecl>(VD) && VD->isConstexpr())
         return GVA_DiscardableODR;