-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
Bugzilla Link | 42888 |
Version | 8.0 |
OS | Linux |
Attachments | Source code illustrating the problem |
CC | @DougGregor,@zygoloid |
Extended Description
For the attached source file, clang++ errors out with
main.C:18:4: error: invalid operands to binary expression ('AA' and 'S<E, EV>')
a << x;
~ ^ ~
main.C:10:14: note: candidate template ignored: substitution failure [with E = E]: deduced non-type template argument does not have the same type as the corresponding template parameter ('E *' vs 'const E *')
friend AA& operator<<( AA& os, const S<E,V>& e );
g++ handles the template fine.
Removing the constness of the second operator parameter or adding constness to the variable makes the problem disappear.
In my application a different operatow was chosen leading to a misbehavior.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"