]> granicus.if.org Git - clang/commit
Variadic templates: extend Type, NestedNameSpecifier, TemplateName,
authorDouglas Gregor <dgregor@apple.com>
Mon, 13 Dec 2010 22:49:22 +0000 (22:49 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 13 Dec 2010 22:49:22 +0000 (22:49 +0000)
commitd0937224f383c7cc72c947119380f9713a070c73
tree4a7ffd1e9f8fa276b23f555166bf429f1be2274b
parent140a2bd77539b4537010d8cd6a0a3805ce724b3e
Variadic templates: extend Type, NestedNameSpecifier, TemplateName,
and TemplateArgument with an operation that determines whether there
are any unexpanded parameter packs within that construct. Use this
information to diagnose the appearance of the names of parameter packs
that have not been expanded (C++ [temp.variadic]p5). Since this
property is checked often (every declaration, ever expression
statement, etc.), we extend Type and Expr with a bit storing the
result of this computation, rather than walking the AST each time to
determine whether any unexpanded parameter packs occur.

This commit is deficient in several ways, which will be remedied with
future commits:
  - Expr has a bit to store the presence of an unexpanded parameter
  pack, but it is never set.
  - The error messages don't point out where the unexpanded parameter
  packs were named in the type/expression, but they should.
  - We don't check for unexpanded parameter packs in all of the places
  where we should.
  - Testing is sparse, pending the resolution of the above three
  issues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121724 91177308-0d34-0410-b5e6-96231b3b80d8
20 files changed:
include/clang/AST/DeclTemplate.h
include/clang/AST/Expr.h
include/clang/AST/NestedNameSpecifier.h
include/clang/AST/Stmt.h
include/clang/AST/TemplateBase.h
include/clang/AST/TemplateName.h
include/clang/AST/Type.h
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/AST/NestedNameSpecifier.cpp
lib/AST/TemplateBase.cpp
lib/AST/TemplateName.cpp
lib/AST/Type.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaTemplate.cpp
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriterStmt.cpp
test/CXX/temp/temp.decls/temp.variadic/p5.cpp [new file with mode: 0644]