llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.45k stars 12.17k forks source link

Clang accepts invalid code when an auto arg #48413

Open llvmbot opened 3 years ago

llvmbot commented 3 years ago
Bugzilla Link 49069
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @dwblaikie,@zygoloid

Extended Description

clang trunk accepts the following code.

template<>
int func( int a, auto b ) { return a + b; }

int main( ) {
    return func( 1, true );
}

It's not a specialization, and allows an empty template parameter list.

llvmbot commented 3 years ago

Sorry, meant to add, the addition of the auto parameter is when this is exhibited.

template<>
int func( int, int ) { return 1; } 

fails as it should.