- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Compiling the following code:
template <typename T> struct Outer { struct Inner { template <typename U> Outer<U> foo(); }; }; template <typename T> template <typename U> Outer<U> Outer<T>::Inner::foo() { return {}; }
Fails to compile with ICC 19.0.0.117, while it should be correct.
GCC and Clang can compile this without issues.
ICC emits the following compilation errors:
main.cpp(10): warning #2357: "Outer<U>" cannot be specified in a template member definition -- "Outer<T>" assumed instead Outer<U> Outer<T>::Inner::foo() { ^ main.cpp(10): error: declaration is incompatible with function template "Outer<U> Outer<T>::Inner::foo<U>()" (declared at line 5) Outer<U> Outer<T>::Inner::foo() { ^ compilation aborted for main.cpp (code 2)
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for report this issue. I've filed a bug with the Developer. The internal case number is CMPLRS-52589.
Regards,
Viet

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page