[PATCH] D16396: Warn if variable cannot be implicitly instantiated

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 13 06:08:36 PDT 2016


sepavloff updated this revision to Diff 53547.
sepavloff added a comment.

Updated patch according to review notes.

The patch adds diagnostics for undefined function templates, in a similar way
as for template variables. These two warnings are classified into different groups.
Warnings on undefined variable templates are enabled by default. This is more
error-prone case, existence of PR24425 may be considered as an evidence. Warnings
on undefined function templates are off by default. If it is enabled,
about 80 tests require update.

References to template declarations can now be printed in two ways. The usual way
is to print only names, such as 'C1::C2', it is compact and convenient when the
reference occurs inside template definition. The patch adds new format, in which
template parameters are also printed, like 'C1<T>::C2<T1,N1>', it can be more
convenient if the template is referenced from outside.


http://reviews.llvm.org/D16396

Files:
  include/clang/AST/ASTContext.h
  include/clang/AST/PrettyPrinter.h
  include/clang/Basic/DiagnosticGroups.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Sema/Sema.h
  lib/AST/ASTDiagnostic.cpp
  lib/AST/Decl.cpp
  lib/Sema/SemaTemplateInstantiateDecl.cpp
  test/CXX/temp/temp.decls/temp.mem/p1.cpp
  test/OpenMP/parallel_ast_print.cpp
  test/OpenMP/parallel_sections_ast_print.cpp
  test/OpenMP/target_parallel_ast_print.cpp
  test/OpenMP/task_ast_print.cpp
  test/OpenMP/teams_ast_print.cpp
  test/OpenMP/threadprivate_ast_print.cpp
  test/SemaCXX/PR10177.cpp
  test/SemaCXX/undefined-internal.cpp
  test/SemaTemplate/undefined-template.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16396.53547.patch
Type: text/x-patch
Size: 23050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160413/dcf10bad/attachment-0001.bin>


More information about the cfe-commits mailing list