[llvm-bugs] [Bug 46329] New: Inconsistent error message in "expected unqualified-id"

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 15 08:43:02 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46329

            Bug ID: 46329
           Summary: Inconsistent error message in "expected
                    unqualified-id"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: haoxintu at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

This code,test.cc, makes clang in a different error message. Clang-trunk emits
only one error message, but clang-10 or clang-9 emits two error messages.

$cat test.cc
int a() {
  ::template b<int> c {} ;
}

$clang++-trunk -c test.cc 
test.cc:2:14: error: no member named 'b' in the global namespace
  ::template b<int> c {} ;
  ~~         ^
1 error generated.

$clang++-10 -c test.cc 
test.cc:2:14: error: no member named 'b' in the global namespace
  ::template b<int> c {} ;
  ~~         ^
test.cc:2:15: error: expected unqualified-id
  ::template b<int> c {} ;
              ^
2 errors generated.

$clang++-9 -c test.cc
test.cc:2:14: error: no member named 'b' in the global namespace
  ::template b<int> c {} ;
  ~~         ^
test.cc:2:15: error: expected unqualified-id
  ::template b<int> c {} ;
              ^
2 errors generated.

$clang++-trunk --version
clang version 11.0.0 (https://github.com/llvm/llvm-project
e6aba43cda848f4a8cfa5ce9f174b77def10e9df)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/compilers/llvm-clang/llvm-project/build/bin

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200615/2f0bdfcb/attachment.html>


More information about the llvm-bugs mailing list