Clang error: template argument for template type parameter must be a type (err_template_arg_must_be_type)
Jump to navigation
Jump to search
Text | error: template argument for template type parameter must be a type |
---|---|
Type | Error |
Category | Semantic Issue |
Internal Id | err_template_arg_must_be_type |
Internal Message | template argument for template type parameter must be a type
|
Regular Expression | (?:error|fatal error)\: template argument for template type parameter must be a type
|
First Commit | 2009-03-14 5a8987ca5113 Update tablegen diagnostic files to be in sync with the def files. |
Description
Example
Flags | -xc++
|
|
---|---|---|
Source |
#include <vector>
int main() {
std::vector<5> myVector; // 5 is not a type
}
| |
Compiler Output |
<source>:4:15: error: template argument for template type parameter must be a type /opt/compiler-explorer/gcc-13.2.0/lib/gcc/x86_64-linux-gnu/13.2.0/../../../../include/c++/13.2.0/bits/stl_vector.h:424:21: note: template parameter is declared here |
Clang Internals (17.0.6)
Git Commit Message
Update tablegen diagnostic files to be in sync with the def files. llvm-svn: 67004
Used in Clang Sources
This section lists all occurrences of the diagnostic within the Clang's codebase. For each occurrence, an auto-extracted snipped from the source code is listed including key elements like control structures, functions, or classes. It should illustrate the conditions under which the diagnostic is activated.
clang/lib/Sema/SemaTemplate.cpp (line 5284)
bool Sema::CheckTemplateTypeArgument(TemplateTypeParmDecl *Param, TemplateArgumentLoc &AL, SmallVectorImpl<TemplateArgument> &SugaredConverted, SmallVectorImpl<TemplateArgument> &CanonicalConverted) {
// ...
default: {
// ...
Diag(SR.getBegin(), diag::err_template_arg_must_be_type) << SR;
Triggered in Clang Tests
This section lists all internal Clang test cases that trigger the diagnostic.
clang/test/SemaCXX/dcl_ambig_res.cpp
- clang/test/SemaCXX/dcl_ambig_res.cpp:41:4: error: template argument for template type parameter must be a type