You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (#110638)
Fixes#110558.
In this patch, we will emit a diagnostic note pointing to the class
declaration when a method definition does not match any declaration.
This approach, similar to what GCC does, makes the diagnostic more
user-friendly.
---------
Co-authored-by: Vlad Serebrennikov <[email protected]>
Copy file name to clipboardExpand all lines: clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -164,11 +164,12 @@ namespace {
164
164
165
165
#if __cplusplus < 201402L
166
166
namespaceImplicitConstexprDef {
167
-
structA {
167
+
structA {// #defined-here
168
168
voidf(); // expected-note {{member declaration does not match because it is not const qualified}}
169
169
};
170
170
171
171
constexprvoidA::f() { } // expected-warning {{'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior}}
172
172
// expected-error@-1 {{out-of-line definition of 'f' does not match any declaration in 'ImplicitConstexprDef::A'}}
// expected-error@-1 {{nested name specifier 'A<Y>::B<double>::' for declaration does not refer into a class, class template or class template partial specialization}}
0 commit comments