summaryrefslogtreecommitdiffstats
path: root/clang/include
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-12-02 02:48:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-12-02 02:48:42 +0000
commit435e647a4145239fbbf77b09a8f1b4d8bf4cd47e (patch)
tree5a8c87bf719506ce6a773c86b098f4d93dfa2803 /clang/include
parenta8c5d3af60e61614c1b5a4c8e203c85ada9203e9 (diff)
downloadbcm5719-llvm-435e647a4145239fbbf77b09a8f1b4d8bf4cd47e.tar.gz
bcm5719-llvm-435e647a4145239fbbf77b09a8f1b4d8bf4cd47e.zip
PR35456: Track definedness of variable template specializations separately from
whether they have an initializer. We cannot distinguish between a declaration of a variable template specialization and a definition of one that lacks an initializer without this, and would previously mistake the latter for the former. llvm-svn: 319605
Diffstat (limited to 'clang/include')
-rw-r--r--clang/include/clang/AST/DeclTemplate.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h
index 991f0736065..96493fc78bd 100644
--- a/clang/include/clang/AST/DeclTemplate.h
+++ b/clang/include/clang/AST/DeclTemplate.h
@@ -2540,6 +2540,12 @@ class VarTemplateSpecializationDecl : public VarDecl,
/// Really a value of type TemplateSpecializationKind.
unsigned SpecializationKind : 3;
+ /// \brief Whether this declaration is a complete definition of the
+ /// variable template specialization. We can't otherwise tell apart
+ /// an instantiated declaration from an instantiated definition with
+ /// no initializer.
+ unsigned IsCompleteDefinition : 1;
+
protected:
VarTemplateSpecializationDecl(Kind DK, ASTContext &Context, DeclContext *DC,
SourceLocation StartLoc, SourceLocation IdLoc,
@@ -2553,6 +2559,7 @@ protected:
public:
friend class ASTDeclReader;
friend class ASTDeclWriter;
+ friend class VarDecl;
static VarTemplateSpecializationDecl *
Create(ASTContext &Context, DeclContext *DC, SourceLocation StartLoc,
@@ -2616,6 +2623,8 @@ public:
PointOfInstantiation = Loc;
}
+ void setCompleteDefinition() { IsCompleteDefinition = true; }
+
/// \brief If this variable template specialization is an instantiation of
/// a template (rather than an explicit specialization), return the
/// variable template or variable template partial specialization from which
OpenPOWER on IntegriCloud