================ @@ -5317,6 +5317,34 @@ TEST_P(ASTImporterOptionSpecificTestBase, EXPECT_FALSE(ToX); } +TEST_P(ASTImporterOptionSpecificTestBase, VarTemplateDeclInlineWithCXX17) { + Decl *FromTU = getTuDecl( + R"( + struct S { + template <unsigned> static constexpr bool X = true; + }; + )", + Lang_CXX17, "input1.cc"); + Decl *FromTU2 = getTuDecl( + R"( + struct S { + template <unsigned> static constexpr bool X = true; + template <typename T> void get() { X<sizeof(T)>; } + }; + template <typename T> T qvariant_cast(const S &v) { return v.get; } ---------------- NagyDonat wrote:
```suggestion template <typename U> U qvariant_cast(const S &v) { return v.get; } ``` At first I thought that the template argument `typename T` of this definition is intended to correspond to the same type as the `typename T` in the definition of `get`, while it seems to be a different type, and if this is true, then it'd be better to use a different name. (By the way, is it intentional that you return `v.get` without calling it?) https://github.com/llvm/llvm-project/pull/87314 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits