[clang] da555f7 - [clang-repl] Additional test for disambiguation of templates

Jonas Hahnfeld via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 9 07:15:28 PDT 2023


Author: Jonas Hahnfeld
Date: 2023-08-09T16:15:14+02:00
New Revision: da555f750ab21d200ce486b45af75476662ca3b5

URL: https://github.com/llvm/llvm-project/commit/da555f750ab21d200ce486b45af75476662ca3b5
DIFF: https://github.com/llvm/llvm-project/commit/da555f750ab21d200ce486b45af75476662ca3b5.diff

LOG: [clang-repl] Additional test for disambiguation of templates

This test case was fixed in commit 2c4620c1 ("Consider the scope spec
in template lookups for deduction guides."), but it is worth having a
dedicated test case with a templated struct and a using declaration.

Differential Revision: https://reviews.llvm.org/D157477

Added: 
    

Modified: 
    clang/test/Interpreter/disambiguate-decl-stmt.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/Interpreter/disambiguate-decl-stmt.cpp b/clang/test/Interpreter/disambiguate-decl-stmt.cpp
index 85160b6d8a9bf6..4553a560ee5324 100644
--- a/clang/test/Interpreter/disambiguate-decl-stmt.cpp
+++ b/clang/test/Interpreter/disambiguate-decl-stmt.cpp
@@ -11,6 +11,10 @@ extern "C" int printf(const char*,...);
 namespace ns1 { template<typename T> void tmplt(T &) {}}
 int arg_tmplt = 12; ns1::tmplt(arg_tmplt);
 
+namespace ns2 { template <typename T> struct S {}; }
+namespace ns3 { struct A { public: using S = int; }; }
+namespace ns3 { A::S f(A::S a); }
+
 // ParseStatementOrDeclaration returns multiple statements.
 #ifdef MS
 int g_bFlag = 1;


        


More information about the cfe-commits mailing list