-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 concepts
Description
Consider following example:
template <typename T, typename U>
struct function;
template <typename T, typename U>
requires (__is_same(U, int))
struct function<T, U> {
void foo();
};
template <typename T, typename U>
requires (__is_same(U, float))
struct function<T, U> {
void foo();
};The second specialization and third specialization should have different USR, but actually same
c:@SP>2#T#T@function>#t0.0#t0.1
c:@SP>2#T#T@function>#t0.0#t0.1Thie is beacuse the USRGenerator doesn't handle requirements in TemplateDecl. See
llvm-project/clang/lib/Index/USRGeneration.cpp
Lines 352 to 361 in caeefe7
| if (const VarTemplateSpecializationDecl *Spec | |
| = dyn_cast<VarTemplateSpecializationDecl>(D)) { | |
| const TemplateArgumentList &Args = Spec->getTemplateArgs(); | |
| Out << '>'; | |
| for (unsigned I = 0, N = Args.size(); I != N; ++I) { | |
| Out << '#'; | |
| VisitTemplateArgument(Args.get(I)); | |
| } | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 concepts