Bug 83447 - parameter after function parameter pack gets improperly deduced
Summary: parameter after function parameter pack gets improperly deduced
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2017-12-17 14:49 UTC by Barry Revzin
Modified: 2021-08-09 22:38 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Barry Revzin 2017-12-17 14:49:53 UTC
This example compiles:

    template <typename... Args, typename T>
    void foo(Args..., T ) { }

    int main() {
        foo(0);
    }

with Args deducing as empty and T as int. But Args is a non-deduced context (http://eel.is/c++draft/temp#deduct.type-5.7). And I don't think "trailing" can be said to apply to Args here (http://eel.is/c++draft/temp#arg.explicit-3.sentence-2). The call should fail.
Comment 1 Andrew Pinski 2021-08-09 22:38:02 UTC
GCC, ICC and clang all accept this code.