== Why is this an issue?

The {cpp} specification forbids the qualification of reference types with ``++const++`` or ``++volatile++`` unless it happens via a ``++typedef++``, in which case it's ignored. Most compilers treat such direct qualifications as errors, but the Microsoft compiler allows them.


This rule raises an issue on both types of ``++const++`` qualification.


=== Noncompliant code example

[source,cpp]
----
void example(char c) {
  char & const direct = c; // Noncompliant

  typedef char & T;
  const T indirect = c; // Noncompliant
}
----


=== Compliant solution

[source,cpp]
----
void example(char c) {
  char & direct = c; // or: const char & direct = c;

  typedef char & T;
  T indirect = c;
}
----


== Resources

* CERT - https://wiki.sei.cmu.edu/confluence/display/cplusplus/DCL52-CPP.+Never+qualify+a+reference+type+with+const+or+volatile[DCL52-CPP. Never qualify a reference type with const or volatile]

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Remove this cv-qualifier.


=== Highlighting

``++const++``


endif::env-github,rspecator-view[]
