Avoid storing information for definitions since those can be out-of-line and
vary between modules even when the declarations are the same.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334151
91177308-0d34-0410-b5e6-
96231b3b80d8
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
Visit(D->getTemplatedDecl());
- ID.AddInteger(D->getTemplatedDecl()->getODRHash());
+ AddDecl(D->getTemplatedDecl());
Inherited::VisitFunctionTemplateDecl(D);
}
};
#endif
// expected-error@second.h:* {{'FunctionDecl::F10' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
+
+#if defined(FIRST)
+struct S11 {
+ template <int> void foo();
+};
+#elif defined(SECOND)
+struct S11 {
+ template <int> void foo();
+};
+template <int> void S11::foo() {}
+#else
+S11 s11;
+#endif
+
} // namespace FunctionDecl
namespace DeclTemplateArguments {