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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to