Skip to content

Emitting attribute diagnostics twice in some template instantiations #135012

Open
@AaronBallman

Description

@AaronBallman

Consider the following:

template <class T>
void f(T __attribute__((align_value(4))) x) {} // expected-warning 2 {{'align_value' attribute only applies to a pointer or reference ('int' is invalid)}}

void foo() {
  f<int>(0); // expected-note {{while substituting explicitly-specified template arguments into function template 'f'}} \
                expected-note {{while substituting deduced template arguments into function template 'f' [with T = int]}}
}

It would be ideal to only diagnose once rather than twice. We get one diagnostic from explicit template arguments and another one for deduced template arguments, which seems silly.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions