11import cpp
22
3+ /**
4+ * Common base class for modeling compiler extensions.
5+ */
6+ abstract class CompilerExtension extends Locatable { }
7+
38/**
49 * A usage of a compiler extension in C++ code, such as non-standard attributes or built-in function
510 * calls.
611 */
7- abstract class CPPCompilerExtension extends Locatable {
12+ abstract class CPPCompilerExtension extends CompilerExtension {
813 abstract string getMessage ( ) ;
914}
1015
@@ -27,8 +32,8 @@ class CPPAttributeExtension extends CPPCompilerExtension, Attribute {
2732/**
2833 * A `StdAttribute` within a compiler specific namespace such as `[[gnu::weak]]`.
2934 */
30- class CppNamespacedStdAttributeExtension extends CPPCompilerExtension , StdAttribute {
31- CppNamespacedStdAttributeExtension ( ) { exists ( this .getNamespace ( ) ) and not getNamespace ( ) = "" }
35+ class CPPNamespacedStdAttributeExtension extends CPPCompilerExtension , StdAttribute {
36+ CPPNamespacedStdAttributeExtension ( ) { exists ( this .getNamespace ( ) ) and not getNamespace ( ) = "" }
3237
3338 override string getMessage ( ) {
3439 result =
@@ -41,11 +46,11 @@ class CppNamespacedStdAttributeExtension extends CPPCompilerExtension, StdAttrib
4146 * A `StdAttribute` with a name not recognized as part of the C++17 standard.
4247 *
4348 * Only the listed names are valid C++17. Namespaced attributes are handled by
44- * `CppNamespacedStdAttributeExtension ` and not considered here.
49+ * `CPPNamespacedStdAttributeExtension ` and not considered here.
4550 */
46- class CppUnrecognizedAttributeExtension extends CPPCompilerExtension , StdAttribute {
47- CppUnrecognizedAttributeExtension ( ) {
48- not this instanceof CppNamespacedStdAttributeExtension and
51+ class CPPUnrecognizedAttributeExtension extends CPPCompilerExtension , StdAttribute {
52+ CPPUnrecognizedAttributeExtension ( ) {
53+ not this instanceof CPPNamespacedStdAttributeExtension and
4954 not getName ( ) in [
5055 "maybe_unused" , "nodiscard" , "noreturn" , "deprecated" , "carries_dependency" , "fallthrough"
5156 ]
0 commit comments