Bug 87712 - class template argument deduction fails with wrapped parentheses
Summary: class template argument deduction fails with wrapped parentheses
Status: RESOLVED DUPLICATE of bug 87709
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-23 17:25 UTC by Barry Revzin
Modified: 2018-10-23 17:37 UTC (History)
0 users

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 2018-10-23 17:25:51 UTC
Reduced from https://stackoverflow.com/q/52950967/2069064:

template <class T>
struct lit {
    lit(T );
};

template <typename T>
void operator+(lit<T>, int);

int main() {
    auto a = lit('b');    // ok
    auto b = (lit('b'));  // ok
    lit('b') + 1;         // ok
    (lit('b')) + 1;       // error: missing template arguments after 'lit'
    (lit('b') + 1);       // ok
}
Comment 1 Marek Polacek 2018-10-23 17:29:08 UTC
This is likely a dup of 87709.
Comment 2 Jonathan Wakely 2018-10-23 17:33:15 UTC
Looks almost identical.

*** This bug has been marked as a duplicate of bug 87709 ***
Comment 3 Barry Revzin 2018-10-23 17:37:27 UTC
Didn't realize the OP had filed a bug report already.