[PATCH] D127284: [clang-repl] Support statements on global scope in incremental mode.

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 1 10:28:48 PDT 2022

v.g.vassilev added inline comments.

Comment at: clang/lib/Parse/ParseDecl.cpp:3381
                                      &SS) &&
           isConstructorDeclarator(/*Unqualified*/ false))
         goto DoneWithDeclSpec;
The only remaining failure is in `test/Parser/cxx-class.cpp` where we have something similar to:
namespace ctor_error {
  class Ctor { // expected-note{{not complete until the closing '}'}}
    Ctor(f)(int); // ok
    Ctor(g(int)); // ok

  Ctor::Ctor (x) = { 0 }; // \
    // expected-error{{qualified reference to 'Ctor' is a constructor name}}

Now, `Ctor::Ctor` is recognized as a constructor and the diagnostic message regresses to:
error: 'error' diagnostics expected but not seen: 
  File /home/vvassilev/workspace/sources/llvm-project/clang/test/Parser/cxx-class.cpp Line 116: qualified reference to 'Ctor' is a constructor name
error: 'error' diagnostics seen but not expected: 
  File /home/vvassilev/workspace/sources/llvm-project/clang/test/Parser/cxx-class.cpp Line 116: unknown type name 'x'
2 errors generated.

It seems that the more accurate diagnostic used to come from `Actions.getTypeName`... Any ideas how to fix this?



More information about the cfe-commits mailing list