[PATCH] D16579: Warn if friend function depends on template parameters.

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 9 01:21:18 PDT 2016


sepavloff marked 6 inline comments as done.

================
Comment at: include/clang/Sema/Sema.h:9469
@@ +9468,3 @@
+  /// of proper templates, but they are needed for checks.
+  SmallVector<FunctionDecl *, 16> FriendsOfTemplates;
+
----------------
Do we really need it? When compiler is compiling a module containing enclosing class, it must emit these warning, as it does for separate file. The advice it issues is valid in this case also. When compiler compiles code that uses the module, warning is not needed as it must already been issued. So, it looks like serializing this array is not needed.

================
Comment at: lib/Sema/SemaChecking.cpp:10936
@@ +10935,3 @@
+/// function types.
+/*
+class FunctionMatcher : public TypeMatcher<FunctionMatcher> {
----------------
The visitor class is split into two auxiliary classes. Although amount of code becomes larger, maintainability should be better, as large amount of code is obtained from RecursiveASTVisitor in standard way/ the other is not specific to friend functions.


http://reviews.llvm.org/D16579





More information about the cfe-commits mailing list