summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-12 23:25:50 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-12 23:25:50 +0000
commit1b57ff32a828c485f5b685ffe02e2effa79f405a (patch)
tree79d0cd3dbd5bff8a94b409d94fd36b947fb3b6e3 /clang/lib/Sema/SemaDecl.cpp
parente83b560e0687b83a118ee352a93bc10014153248 (diff)
downloadbcm5719-llvm-1b57ff32a828c485f5b685ffe02e2effa79f405a.tar.gz
bcm5719-llvm-1b57ff32a828c485f5b685ffe02e2effa79f405a.zip
Implement parsing for explicit instantiations of class templates, e.g.,
template class X<int>; This also cleans up the propagation of template information through declaration parsing, which is used to improve some diagnostics. llvm-svn: 71608
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index b233021c42b..523e71e9b78 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -1017,13 +1017,16 @@ Sema::DeclPtrTy Sema::ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
// FIXME: Warn on useless const/volatile
// FIXME: Warn on useless static/extern/typedef/private_extern/mutable
// FIXME: Warn on useless attributes
-
TagDecl *Tag = 0;
if (DS.getTypeSpecType() == DeclSpec::TST_class ||
DS.getTypeSpecType() == DeclSpec::TST_struct ||
DS.getTypeSpecType() == DeclSpec::TST_union ||
- DS.getTypeSpecType() == DeclSpec::TST_enum)
+ DS.getTypeSpecType() == DeclSpec::TST_enum) {
+ if (!DS.getTypeRep()) // We probably had an error
+ return DeclPtrTy();
+
Tag = dyn_cast<TagDecl>(static_cast<Decl *>(DS.getTypeRep()));
+ }
if (RecordDecl *Record = dyn_cast_or_null<RecordDecl>(Tag)) {
if (!Record->getDeclName() && Record->isDefinition() &&
OpenPOWER on IntegriCloud