Skip to content

Commit

Permalink
Checking operator names
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Jul 22, 2024
1 parent 32e8139 commit 493b643
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,17 @@ class DeclaratorHandler(lang: CXXLanguageFrontend) :
/*
* As always, there are some special cases to consider and one of those are C++ operators.
* They are regarded as functions and eclipse CDT for some reason introduces a whitespace
<<<<<<< HEAD
<<<<<<< HEAD
* in the function name, which will complicate things later on. But we only want to replace
* the whitespace for "standard" operators.
=======
* in the function name, which will complicate things later on
>>>>>>> a5d63345d6 (Added `OperatorDeclaration`)
=======
* in the function name, which will complicate things later on. But we only want to replace
* the whitespace for "standard" operators.
>>>>>>> 478c404aed (Checking operator names)
*/
if (nameDecl.name is CPPASTOperatorName && name.replace(" ", "").isKnownOperatorName) {
name = name.replace(" ", "")
Expand Down Expand Up @@ -515,9 +520,9 @@ class DeclaratorHandler(lang: CXXLanguageFrontend) :
}

/** Checks whether the [Name] for a function is a known operator name. */
val Name.isKnownOperatorName: Boolean
private val Name.isKnownOperatorName: Boolean
get() {
var language = language
val language = language
if (language !is HasOperatorOverloading) {
return false
}
Expand Down

0 comments on commit 493b643

Please sign in to comment.