Clang error: a space is required between consecutive right angle brackets (use '> >') (err_two_right_angle_brackets_need_space)
Jump to navigation
Jump to search
Text | error: a space is required between consecutive right angle brackets (use '> >') |
---|---|
Type | Error |
Category | Parse Issue |
Internal Id | err_two_right_angle_brackets_need_space |
Internal Message | a space is required between consecutive right angle brackets (use '> >')
|
Regular Expression | (?:error|fatal error)\: a space is required between consecutive right angle brackets \(use '\> \>'\)
|
First Commit | 2009-03-04 b1c4d5507fad The basic representation of diagnostics information in tablegen format, plus (uncommented and incomp... |
Description
Example
Flags | -xc++ -std=c++98
|
|
---|---|---|
Source |
#include <vector>
int main() {
// Missing space between consecutive '>'
std::vector<std::vector<int>> v;
return 0;
}
| |
Compiler Output |
<source>:5:32: error: a space is required between consecutive right angle brackets (use '> >') |
Clang Internals (17.0.6)
Git Commit Message
The basic representation of diagnostics information in tablegen format, plus (uncommented and incomplete) test conversions of the existing def files to this format. llvm-svn: 66064
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/Parse/ParseTemplate.cpp (line 1203)
/// Parses a '>' at the end of a template list.
///
/// If this function encounters '>>', '>>>', '>=', or '>>=', it tries
/// to determine if these tokens were supposed to be a '>' followed by
/// '>', '>>', '>=', or '>='. It emits an appropriate diagnostic if necessary.
///
/// \param RAngleLoc the location of the consumed '>'.
///
/// \param ConsumeLastToken if true, the '>' is consumed.
///
/// \param ObjCGenericList if true, this is the '>' closing an Objective-C
/// type parameter or type argument list, rather than a C++ template parameter
/// or argument list.
///
/// \returns true, if current token does not start with '>', false otherwise.
bool Parser::ParseGreaterThanInTemplateList(SourceLocation LAngleLoc, SourceLocation &RAngleLoc, bool ConsumeLastToken, bool ObjCGenericList) {
// ...
// Diagnose this situation as appropriate.
if (!ObjCGenericList) {
// ...
unsigned DiagId = diag::err_two_right_angle_brackets_need_space;
Triggered in Clang Tests
This section lists all internal Clang test cases that trigger the diagnostic.
clang/test/CXX/temp/temp.param/p15.cpp
- clang/test/CXX/temp/temp.param/p15.cpp:6:8: error: a space is required between consecutive right angle brackets (use '> >')
- clang/test/CXX/temp/temp.param/p15.cpp:8:12: error: a space is required between consecutive right angle brackets (use '> >')
- clang/test/CXX/temp/temp.param/p15.cpp:9:5: error: a space is required between consecutive right angle brackets (use '> >')